Load and save comment edits via wordpress-rs without a FluxC row - #23100
Merged
Conversation
Lift the debug-only restriction so the new wordpress-rs comments screens can be opted into outside debug builds for broader soak testing. The flag still defaults off and routing is unchanged.
On rs-capable sites (WP.com REST or application password) the comment editor now loads via the edit-context retrieve (raw content + author email) and saves via wordpress-rs without requiring a pre-existing FluxC comment row — the post-save cache mirror is best-effort, applied only when a row exists. Non-rs sites (XML-RPC via the legacy/reader launch points) keep the FluxC load and save path unchanged.
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #23100 +/- ##
==========================================
+ Coverage 37.58% 37.59% +0.01%
==========================================
Files 2341 2341
Lines 127106 127121 +15
Branches 17614 17619 +5
==========================================
+ Hits 47767 47789 +22
+ Misses 75427 75419 -8
- Partials 3912 3913 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ocalCommentId - Add a test covering the reader identifier on an rs-capable site (the real-world reader edit path: rs load + rs save + reader table update) - Collapse mapCommentEssentials' duplicated fallback into loadCommentViaRs/ loadCommentViaFluxC helpers, matching the save-side naming - Remove SiteCommentIdentifier.localCommentId and the detail screen pipeline that fed it — nothing reads it now that the editor addresses comments by remote id
The rs empty-list tests hit the opposite-behaving rs mirror guard (save succeeds, skip mirror); nothing exercised the FluxC branch where a missing cache row must fail the save with no DONE and no analytics.
The editor loads the comment from the network, so opening it offline showed an empty screen with a load-error snackbar. Guard onEditClicked with the detail screen's existing isOffline() check, matching moderation and reply.
The rs detail was guarded in the previous commit, but the legacy detail (which hosts comment notifications when the rs detail isn't used) and the reader could still open the editor offline, showing an empty screen with a load-error snackbar. Use NetworkUtils.checkConnection, the same idiom both files already use for reply and moderation.
The stub is load-bearing — without it Mockito returns null for the non-null suspend return and the happy-path test fails. Only the payload is unused, not the stub itself.
nbradbury
marked this pull request as ready for review
July 14, 2026 19:01
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.


Builds on the RS comment editor (#23084), which already saved via wordpress-rs but still leaned on FluxC to load the comment and as a hard precondition for saving. This PR updates that to use wp-rs for comment editing.
Testing