CMM-2256: Offer the wordpress-rs screens to WP.com sites - #23269
Draft
nbradbury wants to merge 1 commit into
Draft
CMM-2256: Offer the wordpress-rs screens to WP.com sites#23269nbradbury wants to merge 1 commit into
nbradbury wants to merge 1 commit into
Conversation
…lout flag Replace the static SiteUtils.canUseWpRs with an injectable WpRsRouting, which admits application-password sites unconditionally and WP.com REST sites behind the new android_wp_rs_wpcom remote flag (default off). WpServiceProvider now routes isUsingWpComRestApi sites over the WP.com transport, matching WpApiClientProvider. WpAppNotifierHandler ignores 401s from sites without an application password so an expired WP.com bearer token can't trigger app-password reauthentication, and PostRsFluxCBridge keeps a cached post with unsynced local edits instead of re-fetching over them.
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #23269 +/- ##
==========================================
+ Coverage 37.80% 37.82% +0.01%
==========================================
Files 2348 2350 +2
Lines 128445 128461 +16
Branches 17805 17808 +3
==========================================
+ Hits 48560 48585 +25
+ Misses 75925 75911 -14
- Partials 3960 3965 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
I plan to leave this in draft until #23270 is merged since that PR will make it easier to test this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
TL/DR: WP.com sites no longer need an application password to get the wordpress-rs posts/pages/comments screens — wordpress-rs reaches them with the OAuth bearer token instead. Gated behind a new remote flag
android_wp_rs_wpcom(default off) so the WP.com audience moves off the legacy screens gradually. This is stage two of the CMM-2256 project (stage one was #23235).The gate moves from the static
SiteUtils.canUseWpRsinto an injectableWpRsRouting, the single rule for all rs entry points: an application password is enough on its own; WP.com REST sites follow the flag.WpServiceProvidernow picks the WP.com transport with the same rule asWpApiClientProvider(isWPCom || isUsingWpComRestApi), which means Jetpack + app-password sites' lists move onto the WP.com proxy their edit-time fetch already used — the main regression risk here.Two supporting fixes:
WpAppNotifierHandlerignores 401s from sites with no application password, so an expired WP.com bearer token can't launch app-password reauthentication; andPostRsFluxCBridgekeeps a cached post holding unsynced local edits instead of re-fetching over them. One deliberate narrowing: comment editing for WP.com sites returns to FluxC while the flag is off, so one predicate governs the whole rs surface.Testing instructions
With the flag off (default), WP.com sites should see no change. To enable it locally: Me → Debug settings → Remote features →
android_wp_rs_wpcom.App-password site is unaffected:
WP.com site follows the flag:
Jetpack + app-password lists still load (transport change is live regardless of the flag):