-
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
Only overwrite Posts that don't have local changes #1064
Only overwrite Posts that don't have local changes #1064
Conversation
…hen listening to completed FETCH_ACTION, only overwrite Posts that don't have local changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @mzorz! I have left a couple nitpick comments, let me know what you think about them.
P.S: I know I was the one who brought up the changes in handleFetchSinglePostCompleted
but I have to say, I am a little bit worried about the potential side effects of it. For one thing, each fetch request will take slightly longer and when a blog post list is visited for the very first time, there will be a lot of these, since we'll fetch each post one by one. Having said that, I can't think of an actual problem with this change, so I am hoping that it's fine :) I just wanted to add my thoughts here in case it proves useful later.
fluxc/src/main/java/org/wordpress/android/fluxc/store/PostStore.java
Outdated
Show resolved
Hide resolved
fluxc/src/main/java/org/wordpress/android/fluxc/store/PostStore.java
Outdated
Show resolved
Hide resolved
fluxc/src/main/java/org/wordpress/android/fluxc/store/PostStore.java
Outdated
Show resolved
Hide resolved
…e.java Co-Authored-By: mzorz <mariozorz@gmail.com>
…e.java Co-Authored-By: mzorz <mariozorz@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
I'll merge once Travis is done 🤞
This PR does two things:
2. also when listening to completedupdated as per convo in in Possible content loss when a draft is published from elsewhere WordPress-Android#5984 (comment)FETCH_ACTION
, only overwrite Posts that don't have local changesOtherwise, local changes were lost for good.
Thanks @oguzkocer for pointing out where to make the changes!