Wordpress-android: Post list status for scheduled posts remain `scheduled` even after published

Created on 18 Jan 2019  ·  5Comments  ·  Source: wordpress-mobile/WordPress-Android

Expected behavior

The Posts list should reflect the status of Posts at any given time.

Actual behavior

For posts that are scheduled the status doesn’t change after the are published. So for any posts that I scheduled on the app, and after the time has passed and the post is published, the post list in the app still says “Scheduled”

Steps to reproduce the behavior

  1. start a new draft and schedule it for the future (1 or 2 minutes ahead). Schedule it so it gets to the server.
  2. wait for the amount of time needed
  3. now observe the Posts list still has these posts as Scheduled.
  4. Observe also, that a pull to refresh doesn't change it.
Tested on [Nexus 5], Android [7.1.1]
Post List [Type] Bug

Most helpful comment

@mzorz I can look into this one most likely next week. I am going to start on the post filters project anyway, so this fits right in :)

All 5 comments

@mzorz I can look into this one most likely next week. I am going to start on the post filters project anyway, so this fits right in :)

Just leaving some more info here (may be relevant as you dive in): I was looking into it and realized some more information is going to be needed in PostStore.PostListItem (as you surely know), I think if we add the Post's status as well (not just lastModified) and we add a check such as the following in this line:

                if (post != null &&
                    (!post.getLastModified().equals(item.lastModified) ||
                     !post.getStatus().equals(item.getStatus()) && !post.isLocallyChanged()) {
                    mDispatcher.dispatch(PostActionBuilder.newFetchPostAction(new RemotePostPayload(post, site)));
                }

then the situation described in this issue would be saved

@mzorz Yeap, that'd definitely be one way to fix it. I'd like to test whether the lastModified date is updated when a scheduled post is published, because a status change should be considered a change in the backend. If it's not being changed, I'll see if we can get that fixed instead. That's not because the fix in client is hard or anything as you already fixed it with a one line change, but it's because I think it's the right thing to do. I'd really like to make lastModified to be a reliable field.

This is a duplicate of https://github.com/wordpress-mobile/WordPress-Android/issues/8601@oguzkocer since you've assigned yourself to this one I'll close the older report.

This also came up in 1779469-zen.

Was this page helpful?
0 / 5 - 0 ratings