Skip to content

CMM-2256: Offer the wordpress-rs screens to WP.com sites - #23269

Draft
nbradbury wants to merge 1 commit into
trunkfrom
rs-no-app-password-part-2
Draft

CMM-2256: Offer the wordpress-rs screens to WP.com sites#23269
nbradbury wants to merge 1 commit into
trunkfrom
rs-no-app-password-part-2

Conversation

@nbradbury

@nbradbury nbradbury commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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.canUseWpRs into an injectable WpRsRouting, the single rule for all rs entry points: an application password is enough on its own; WP.com REST sites follow the flag. WpServiceProvider now picks the WP.com transport with the same rule as WpApiClientProvider (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: WpAppNotifierHandler ignores 401s from sites with no application password, so an expired WP.com bearer token can't launch app-password reauthentication; and PostRsFluxCBridge keeps 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:

  1. Open Posts, Pages, and Comments on a site with an application password.
  • Verify the rs screens appear and load, flag on or off.

WP.com site follows the flag:

  1. With the flag off, open Posts/Pages/Comments on a WP.com site.
  • Verify the legacy screens appear.
  1. Enable the flag and reopen them.
  • Verify the rs screens appear and the lists load.
  1. Edit a comment from the rs list.
  • Verify the edit saves.

Jetpack + app-password lists still load (transport change is live regardless of the flag):

  1. Open Posts and Pages on a Jetpack site holding an application password.
  • Verify the lists load and a post opens in the editor.

…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.
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@nbradbury nbradbury added the WP-RS Related to wordpress-rs label Aug 28, 2026
@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23269-f84303c
Build Number1498
Application IDorg.wordpress.android.prealpha
Commitf84303c
Installation URL0nqchpqcrbud0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23269-f84303c
Build Number1498
Application IDcom.jetpack.android.prealpha
Commitf84303c
Installation URL0dkf431qonp9o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.72414% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.82%. Comparing base (e6f795f) to head (f84303c).

Files with missing lines Patch % Lines
...ava/org/wordpress/android/ui/ActivityLauncher.java 0.00% 7 Missing ⚠️
...press/android/ui/postsrs/data/WpServiceProvider.kt 0.00% 5 Missing ⚠️
...i/comments/unified/UnifiedCommentsEditViewModel.kt 50.00% 0 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury

Copy link
Copy Markdown
Contributor Author

I plan to leave this in draft until #23270 is merged since that PR will make it easier to test this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WP-RS Related to wordpress-rs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants