wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Sync issues: Post conflict handling #20552

Closed pantstamp closed 3 weeks ago

pantstamp commented 1 month ago

Fixes #20531

This PR contains the modifications needed for the new post conflict handling. Specs pcdRpT-5ID-p2#comment-9638.

Note: Existing logic remains unchanged for self-hosted sites; as they do not return conflict response codes.

Merge Instructions

To Test:

Test Post version forced write on top of web (existing logic)

Test Post version did not write on top of web (new logic)

Test Conflict Resolution dialog is shown


Regression Notes

  1. Potential unintended areas of impact The post is not updated properly

  2. What I did to test those areas of impact (or what existing automated tests I relied on) Updated existing unit tests. Added PostConflictResolverTest and SyncPublishingFeatureUtilsTest

  3. What automated tests I added (or what prevented me from doing so) Relied upon existing automated post tests


PR Submission Checklist:


Testing Checklist (strike-out the not-applying and unnecessary ones): No UI components were changed with this PR

wpmobilebot commented 1 month ago
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20552-edc512e
Commitedc512e0ebbcdad5eba5f3d941e8438ab9aa0c75
Direct Downloadwordpress-prototype-build-pr20552-edc512e.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 1 month ago
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20552-edc512e
Commitedc512e0ebbcdad5eba5f3d941e8438ab9aa0c75
Direct Downloadjetpack-prototype-build-pr20552-edc512e.apk
Note: Google Login is not supported on these builds.
codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 36.73469% with 62 lines in your changes are missing coverage. Please review.

Project coverage is 40.39%. Comparing base (15001b9) to head (614fc1d).

:exclamation: Current head 614fc1d differs from pull request most recent head edc512e. Consider uploading reports for the commit edc512e to get more accurate results

Files Patch % Lines
...ordpress/android/ui/uploads/PostUploadHandler.java 0.00% 21 Missing :warning:
...ordpress/android/ui/posts/PostListEventListener.kt 0.00% 18 Missing :warning:
...org/wordpress/android/ui/posts/PostUploadAction.kt 0.00% 4 Missing :warning:
...wordpress/android/ui/uploads/UploadUtilsWrapper.kt 0.00% 4 Missing :warning:
...d/viewmodel/pages/PostModelUploadUiStateUseCase.kt 0.00% 4 Missing :warning:
...wordpress/android/ui/posts/PostConflictResolver.kt 86.95% 0 Missing and 3 partials :warning:
...rg/wordpress/android/ui/uploads/UploadService.java 0.00% 3 Missing :warning:
...rg/wordpress/android/ui/posts/PostActionHandler.kt 50.00% 2 Missing :warning:
.../org/wordpress/android/ui/uploads/UploadUtils.java 0.00% 2 Missing :warning:
...ordpress/android/ui/uploads/UploadActionUseCase.kt 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #20552 +/- ## ========================================== + Coverage 40.34% 40.39% +0.05% ========================================== Files 1473 1474 +1 Lines 67875 67906 +31 Branches 11224 11226 +2 ========================================== + Hits 27386 27433 +47 + Misses 38023 37994 -29 - Partials 2466 2479 +13 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

wpmobilebot commented 3 weeks ago

Found 1 violations:

The PR caused some dependency changes (expand to see details)

```diff -+--- org.wordpress:fluxc:{strictly 2.72.0} -> 2.72.0 -| +--- org.wordpress:wellsql:2.0.0 -| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*) -| | \--- org.wordpress.wellsql:wellsql-annotations:2.0.0 -| +--- org.wordpress.fluxc:fluxc-annotations:2.72.0 -| +--- org.greenrobot:eventbus:3.3.1 -| | \--- org.greenrobot:eventbus-java:3.3.1 -| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0 (*) -| +--- com.android.volley:volley:1.1.1 -> 1.2.1 -| +--- androidx.paging:paging-runtime:2.1.2 -| | +--- androidx.paging:paging-common:2.1.2 -| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*) -| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*) -| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*) -| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*) -| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*) -| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*) -| +--- com.goterl:lazysodium-android:5.0.2 -| +--- net.java.dev.jna:jna:5.5.0 -| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*) -| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.22 (*) -| +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*) -| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*) -| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6 (*) -| +--- androidx.security:security-crypto:1.0.0 -| | +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*) -| | \--- com.google.crypto.tink:tink-android:1.5.0 -| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2 (*) -| +--- com.google.code.gson:gson:2.8.5 -> 2.10.1 -| +--- org.apache.commons:commons-text:1.10.0 -| | \--- org.apache.commons:commons-lang3:3.12.0 -| +--- androidx.room:room-runtime:2.4.2 -> 2.5.0 -| | +--- androidx.annotation:annotation-experimental:1.1.0 -> 1.3.1 (*) -| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.2.0 (*) -| | +--- androidx.room:room-common:2.5.0 -| | | +--- androidx.annotation:annotation:1.3.0 -> 1.6.0 (*) -| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 -> 1.9.10 (*) -| | +--- androidx.sqlite:sqlite:2.3.0 -| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*) -| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*) -| | \--- androidx.sqlite:sqlite-framework:2.3.0 -| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*) -| | +--- androidx.sqlite:sqlite:2.3.0 (*) -| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*) -| +--- androidx.room:room-ktx:2.4.2 -> 2.5.0 -| | +--- androidx.room:room-common:2.5.0 (*) -| | +--- androidx.room:room-runtime:2.5.0 (*) -| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*) -| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) -| +--- com.google.dagger:dagger:2.42 -> 2.50 -| | \--- javax.inject:javax.inject:1 -| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*) -| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*) ++--- org.wordpress:fluxc:{strictly trunk-f154a1ace883ee3e0f4b1308a76c9316109b6b03} -> trunk-f154a1ace883ee3e0f4b1308a76c9316109b6b03 +| +--- org.wordpress:wellsql:2.0.0 +| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*) +| | \--- org.wordpress.wellsql:wellsql-annotations:2.0.0 +| +--- org.wordpress.fluxc:fluxc-annotations:trunk-f154a1ace883ee3e0f4b1308a76c9316109b6b03 +| +--- org.greenrobot:eventbus:3.3.1 +| | \--- org.greenrobot:eventbus-java:3.3.1 +| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0 (*) +| +--- com.android.volley:volley:1.1.1 -> 1.2.1 +| +--- androidx.paging:paging-runtime:2.1.2 +| | +--- androidx.paging:paging-common:2.1.2 +| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*) +| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*) +| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*) +| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*) +| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*) +| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*) +| +--- com.goterl:lazysodium-android:5.0.2 +| +--- net.java.dev.jna:jna:5.5.0 +| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*) +| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.22 (*) +| +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*) +| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*) +| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6 (*) +| +--- androidx.security:security-crypto:1.0.0 +| | +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*) +| | \--- com.google.crypto.tink:tink-android:1.5.0 +| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2 (*) +| +--- com.google.code.gson:gson:2.8.5 -> 2.10.1 +| +--- org.apache.commons:commons-text:1.10.0 +| | \--- org.apache.commons:commons-lang3:3.12.0 +| +--- androidx.room:room-runtime:2.4.2 -> 2.5.0 +| | +--- androidx.annotation:annotation-experimental:1.1.0 -> 1.3.1 (*) +| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.2.0 (*) +| | +--- androidx.room:room-common:2.5.0 +| | | +--- androidx.annotation:annotation:1.3.0 -> 1.6.0 (*) +| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 -> 1.9.10 (*) +| | +--- androidx.sqlite:sqlite:2.3.0 +| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*) +| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*) +| | \--- androidx.sqlite:sqlite-framework:2.3.0 +| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*) +| | +--- androidx.sqlite:sqlite:2.3.0 (*) +| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*) +| +--- androidx.room:room-ktx:2.4.2 -> 2.5.0 +| | +--- androidx.room:room-common:2.5.0 (*) +| | +--- androidx.room:room-runtime:2.5.0 (*) +| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*) +| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) +| +--- com.google.dagger:dagger:2.42 -> 2.50 +| | \--- javax.inject:javax.inject:1 +| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*) +| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*) \--- org.wordpress:login:1.14.1 - \--- org.wordpress:fluxc:trunk-ed60798b4d96ec19863c74b0f525e2e20f4525db -> 2.72.0 (*) + \--- org.wordpress:fluxc:trunk-ed60798b4d96ec19863c74b0f525e2e20f4525db -> trunk-f154a1ace883ee3e0f4b1308a76c9316109b6b03 (*) ```

Please review and act accordingly