Repository navigation
Suggest mode: reopen an undone decision with a status the server accepts - #81963
Conversation
The reopen pass wrote _wp_suggestion_status: '' to clear the lifecycle meta, but the registered enum only allows pending, applied and rejected, so the REST request failed after the comment status had already been updated. That left the note half reopened: status back to hold, meta still applied, and the sidebar - which reads the meta - kept the note resolved with no Accept/Reject on it. Write pending instead, which every reader already treats the same as absent meta. Fixes #81962
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: -1 B (0%) Total Size: 7.81 MB 📦 View Changed
|
|
Flaky tests detected in 5e05deb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/32645968093 Navigates the items list via UP/DOWN arrow keys in
|
Claude tracked this one down this morning and wrote the fix:
What?
Fixes #81962: undoing an accepted or rejected suggestion puts the marker back in the content but leaves its note resolved, so the run is marked up again with no Accept or Reject on it and no way to clear it through the UI. Follow-up to #81669 (F-18, part of #73411), based on
suggest/inline-wiring(#80433) like the other Table 1 fixes.Why?
The reopen pass from #81669 does fire - it just half lands. It writes the comment status and the lifecycle meta in one request, and it tried to clear the meta with an empty string:
gutenberg/packages/editor/src/components/suggestion-mode/suggestion-note-gc.js
Lines 396 to 403 in 8ae93d2
_wp_suggestion_statusis registered with an enum ofpending/applied/rejected, so the REST request comes backrest_not_in_enum.WP_REST_Comments_Controller::update_item()updates the comment before it updates meta, so the status change persists while the meta write fails:statuslands back onhold, the meta staysapplied, and the sidebar reads the meta - not the status - to decide whether a decision has been made. Because the save rejects, the note also goes back into the resolved-this-session set, so every later pass retries the same doomed write.How?
Write
pendinginstead - the enum's own word for a suggestion awaiting a decision. Every reader already treatspendingthe same as absent meta: the sidebar counts onlyappliedandrejectedas resolved (suggestion-actions.js), the replacement-pairing scan skips only those two (provider.js), and the note GC's trash gate explicitly allowspending. The unit test expectation now pinspending, so it matches a payload the server will actually take.Two e2e tests already covered this and were failing on the branch (
suggestion-mode-undo.spec.js, the two "reopens its note with the marker" tests). With the fix they pass, along with the rest of the undo spec (12/12) and the GC unit suite.Testing Instructions
gutenberg-suggestion-modeexperiment.Hello, switch to Suggesting (Options menu), and typeworldat the end.Or run the pinned tests:
AI Use
Claude wrote the code and this description, steered from the issue it filed earlier. I will review and test.