Closed zwarm closed 3 weeks ago
2 Warnings | |
---|---|
:warning: | strings.xml files should only be updated on release branches, when the translations are downloaded by our automation. |
:warning: | This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews. |
Generated by :no_entry_sign: Danger
App Name | WordPress | |
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr20635-76f04c8 | |
Commit | 76f04c8c3725fdfe1579d60566a9c08c82d2dd98 | |
Direct Download | wordpress-prototype-build-pr20635-76f04c8.apk |
App Name | Jetpack | |
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr20635-76f04c8 | |
Commit | 76f04c8c3725fdfe1579d60566a9c08c82d2dd98 | |
Direct Download | jetpack-prototype-build-pr20635-76f04c8.apk |
Attention: Patch coverage is 43.94904%
with 88 lines
in your changes are missing coverage. Please review.
Project coverage is 40.46%. Comparing base (
3f7287b
) to head (76f04c8
). Report is 39 commits behind head on trunk.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@zwarm great work! While I was testing it I saw that when the conflict resolution overlay appears for a page and you choose to keep the remote version, event though we see the snackbar that says "Local version discarded", the pages list is not refreshed and we still see the "Version Conflict" label. User need to refresh for it to disappear. Before approving the PR, I will investigate a bit.
@zwarm as I am looking at the code I noticed one difference between post conflict resolution and pages conflict resolution.
When we update a post with the remote version we call
// Conflicted post has been successfully updated with its remote version
uploadStore.clearUploadErrorForPost(updatedPost)
postStore.removeLocalRevision(updatedPost)
in the PostConflictResolver.onPostSuccessfullyUpdated().
I think that these functions are not called anywhere when we update a page with the remote version. Don't we need this there? WDYT?
@zwarm just a thought. If resolving a page conflict is actually resolving a post conflict, would it make sense to reuse the code of the PostConflictResolver? The PageConflictResolver could act like a wrapper for the PostConflictResolver. In this way we could possibly remove the "resolve conflict" logic from the PagesViewModel. WDYT? This is just food for thought an not a request for changes.
@zwarm just a thought. If resolving a page conflict is actually resolving a post conflict, would it make sense to reuse the code of the PostConflictResolver? The PageConflictResolver could act like a wrapper for the PostConflictResolver. In this way we could possibly remove the "resolve conflict" logic from the PagesViewModel. WDYT? This is just food for thought an not a request for changes.
I did think of this originally, but Pages is not architected the same as Posts. Plus I'm not 100% sure about eliminating the logic from PagesViewModel without fully understanding what we'd be removing. However, I am open to exploring again.
@zwarm great work! While I was testing it I saw that when the conflict resolution overlay appears for a page and you choose to keep the remote version, event though we see the snackbar that says "Local version discarded", the pages list is not refreshed and we still see the "Version Conflict" label. User need to refresh for it to disappear. Before approving the PR, I will investigate a bit.
Nice catch, I'll take a look and get this changed.
@zwarm just a thought. If resolving a page conflict is actually resolving a post conflict, would it make sense to reuse the code of the PostConflictResolver? The PageConflictResolver could act like a wrapper for the PostConflictResolver. In this way we could possibly remove the "resolve conflict" logic from the PagesViewModel. WDYT? This is just food for thought an not a request for changes.
I did think of this originally, but Pages is not architected the same as Posts. Plus I'm not 100% sure about eliminating the logic from PagesViewModel without fully understanding what we'd be removing. However, I am open to exploring again.
As I said, this is not a request for change :-) We might consider it afterwards if we see that we duplicate a lot of code.
Issues
2 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Thanks for the refactors @pantstamp 👏 Like the way you moved the logic out of PagesViewModel and added the conflictResolver. I tested and all works as expected. 🙇
This pull request was deployed and Sentry observed the following issues:
org.wordpress.android.ui.pages.PagesFragment$se...
View IssueDid you find this useful? React with a 👍 or 👎
The PR adds support for resolving page conflict resolutions
Specs pcdRpT-5ID-p2#comment-9638.
To Test:
Test Page version forced write on top of web (existing logic)
sync_publishing
flag and restart the appTest Page version did not write on top of web (new logic)
sync_publishing
flag and restart the appTest Conflict Resolution dialog is shown
Regression Notes
Potential unintended areas of impact The page is not updated properly
What I did to test those areas of impact (or what existing automated tests I relied on) Updated
PagesViewModelTest
,PageListViewModelTest
, andCreatePageListItemActionsUseCaseTest
What automated tests I added (or what prevented me from doing so) Relied on existing instrumentation tests
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones):