-
Notifications
You must be signed in to change notification settings - Fork 37
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
Optimize fetch post list call #1364
Conversation
Sorry, I'm having trouble understanding this. Should I wait to review until #10426 is merged? Or the other way around?
I'm hoping to see those first before diving in since, at first glance, this seems like a complicated change and the tests would help me understand this better. 😬 |
You can test the functionality of this PR in wordpress-mobile/WordPress-Android#10426. However, this PR should be merged first.
It's actually not that complicated. I discussed this change with Maxime, but unfortunately he didn't have time to review it. Let me know if you rather want to jump on a quick call. |
Added unit tests in d4ceb54 |
This PR contains a couple of changes:
autosave.lastModified
very soon - Fetch only autosave.modifiedDate object instead of the whole meta object #1277 (PR on the API is almost ready to be merged).handleFetchedPostList
whereisPostChanged
field was comparingitem.autoSave.revisionId != post.getAutoSaveRevisionId()
. The issue was thatautoSaveRevisionId
doesn't change when the content is overridden with newer autosave. It's safer to compareautosave.lastModified
instead which is always updated whenever something changes in the Autosave object.handleFetchedPostList
-> the logic is following2.
(the autosave conflict resolution will be handled in v2)wordpress-mobile/WordPress-Android#10426 is targeting this branch so we'll test these changes as part of the PR in WPAndroid.
P.S. I'll add some test in another PR later today.