Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploaded draft post differs from local draft #310

Closed
AndrewFreemantle opened this issue Nov 4, 2013 · 9 comments
Closed

Uploaded draft post differs from local draft #310

AndrewFreemantle opened this issue Nov 4, 2013 · 9 comments

Comments

@AndrewFreemantle
Copy link

To reproduce:

Edit a draft post, changing some content.
Update content changes (post is still draft).
Once the updating spinner has disappeared, tap the same draft post to edit - the post shows the content 'before' the edit (!)

It appears that refreshing the posts list pulls the changes down.

[App: v3.8.3; self-hosted WP: v3.7.1]

@aerych
Copy link
Member

aerych commented Nov 15, 2013

Unable to reproduce this.

Maybe the post list had started syncing before editing the draft, and finished after the draft was edited. @koke thoughts on this?

@AndrewFreemantle
Copy link
Author

Thanks for looking this, @aerych. I'm on a really slow connection in Cambodia. The speed test in the Ookla test app reads a ping of 40ms, download of 0.40 mbits and upload of 0.82 mbits :/

(ave of 3 runs)

@koke
Copy link
Member

koke commented Nov 20, 2013

From [Blog mergePosts:]:

        Post *newPost = [Post findOrCreateWithBlog:self andPostID:postID];
        if (newPost.remoteStatus == AbstractPostRemoteStatusSync) {
            [newPost updateFromDictionary:postInfo];
        }

So we won't overwrite a post unless it's synced, but that doesn't check if it's being edited. One possible scenario:

  • Sync starts
  • Edit starts
  • Some edits
  • Save and upload
  • Sync finishes

So the edit check is not really the problem. We're updating the post with data that is already too old. We probably should start checking date_modified_gmt before updating posts, unless we can have a better system.

@sendhil
Copy link
Contributor

sendhil commented Mar 4, 2014

@AndrewFreemantle - have you hit this issue on the latest version of the app (3.9.1)?

@sendhil sendhil modified the milestones: 4.1, 4.0.1 Mar 18, 2014
@AndrewFreemantle
Copy link
Author

@sendhil - yes. I find that refreshing the list of posts is also hit and miss, and I've taken to refreshing the list at least 3 times before I have any level of confidence that the version of any given post (especially Draft ones) matches the version on the server.

Still not working as expected in 4.0.1 - sorry :o/

@sendhil
Copy link
Contributor

sendhil commented Apr 14, 2014

Hey @AndrewFreemantle - sorry to hear you are still having problems with this : (. I'll try and take a peek at this later this week.

@AndrewFreemantle
Copy link
Author

It might be helpful to know that our WP server is in the UK (timezone set to GMT) and I'm currently in Japan (timezone set local automatically by iOS) - maybe it's a timezone thing?

@sendhil
Copy link
Contributor

sendhil commented Apr 16, 2014

Hmmm, @astralbodies didn't you bump into something similar to this a few months back?

@astralbodies
Copy link
Contributor

Closing issue and migrating to new repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants