wordpress-mobile / wordpress-mobile/WordPress-Android
Remove the sync_publishing feature flag and dead code behind it
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 3.2k
- Forks
- 1.4k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 69
Description
Summary
The sync_publishing feature flag (backing PostConflictResolutionFeatureConfig) is hardcoded to false in build.gradle and has never been enabled. All code gated behind it is dead code. We should remove the flag and clean up all associated code paths.
What the flag gates
The flag controls a post conflict resolution system that detects when a post has been edited on another device and presents UI to resolve the conflict. When disabled (current state), all conflict checks are skipped (shouldSkipConflictResolutionCheck = true) and legacy dialogs are shown instead of the newer overlay UI.
Key behaviors gated behind the flag
- Post/Page conflict resolution overlay — A Compose-based bottom sheet (
PostResolutionOverlayFragment) that lets users choose between a local or remote version of a conflicted post/page - Post freshness checking in the editor — On opening a post in
EditPostActivity/GutenbergKitActivity, checks if a newer remote version exists and shows an "Updating Post" UI if_not_modified_sinceheader on push — Sends a last-modified timestamp when pushing posts so the backend can return a 409 on conflict (viaPostConflictResolutionFeatureUtils.getRemotePostPayloadForPush)- Conflict detection on edit — In
PagesViewModel.checkAndEdit(), checks for unhandled conflicts before opening the editor
Files to modify or remove
Files to delete entirely
WordPress/src/main/java/org/wordpress/android/util/config/PostConflictResolutionFeatureConfig.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostConflictResolutionFeatureUtils.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostResolutionOverlay.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostResolutionOverlayAnalyticsTracker.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostResolutionOverlayFragment.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostResolutionOverlayListener.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostResolutionOverlayUiState.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostResolutionOverlayViewModel.ktWordPress/src/main/java/org/wordpress/android/ui/posts/PostConflictResolver.ktWordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageConflictResolver.ktWordPress/src/test/java/org/wordpress/android/ui/posts/PostConflictResolutionFeatureUtilsTest.ktWordPress/src/test/java/org/wordpress/android/ui/posts/PostResolutionOverlayAnalyticsTrackerTest.ktWordPress/src/test/java/org/wordpress/android/ui/posts/PostResolutionOverlayViewModelTest.ktWordPress/src/test/java/org/wordpress/android/ui/posts/PostConflictResolverTest.kt
Files to modify (remove flag references and simplify)
WordPress/build.gradle— Remove theSYNC_PUBLISHINGbuildConfigFieldWordPress/src/main/java/org/wordpress/android/ui/posts/PostListDialogHelper.kt— Remove flag-gated branches; keep only theelse(disabled) pathsWordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt— Same as aboveWordPress/src/main/java/org/wordpress/android/ui/posts/PostListMainViewModel.kt— RemovePostConflictResolutionFeatureUtilsinjection and_conflictResolutionActionWordPress/src/main/java/org/wordpress/android/viewmodel/pages/PagesViewModel.kt— RemovePostConflictResolutionFeatureUtilsinjection and conflict check incheckAndEdit()WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StorePostViewModel.kt— RemovePostConflictResolutionFeatureConfiginjection andcheckIfUpdatedPostVersionExists()/handlePostRefreshedIfNeeded()gated logicWordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt— RemovePostConflictResolutionFeatureConfiginjection and freshness-check observersWordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt— Same as EditPostActivityWordPress/src/main/java/org/wordpress/android/ui/uploads/PostUploadHandler.java— RemovePostConflictResolutionFeatureUtils; always setshouldSkipConflictResolutionCheck = trueWordPress/src/main/java/org/wordpress/android/ui/posts/PostActionHandler.kt— RemovePostConflictResolutionFeatureUtilsinjection; simplify payload constructionWordPress/src/test/java/org/wordpress/android/viewmodel/pages/PagesViewModelTest.kt— Remove mock/referencesWordPress/src/test/java/org/wordpress/android/ui/posts/editor/StorePostViewModelTest.kt— Remove mock/referencesWordPress/src/test/java/org/wordpress/android/ui/posts/PostListMainViewModelTest.kt— Remove mock/referencesWordPress/src/test/java/org/wordpress/android/ui/posts/PostListMainViewModelCopyPostTest.kt— Remove mock/references
FluxC files to review
libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/PostStore.java— Check ifshouldSkipConflictResolutionCheck/lastModifiedForConflictResolutiononRemotePostPayloadcan be simplifiedlibs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/post/PostRestClient.java— Samelibs/fluxc/src/main/java/org/wordpress/android/fluxc/network/xmlrpc/post/PostXMLRPCClient.java— Same
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with WordPress/build.gradle and the listed WordPress UI, view-model, upload, and editor files; trace references to sync_publishing and the conflict-resolution classes. Remove the flag-gated code and listed dead files, update the named tests, then review the FluxC PostStore and client files for remaining conflict fields. Done means no obsolete flag or conflict-resolution references remain and the affected tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- build-system, mobile
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100