Clear resolved patch errors after discard - #331
Merged
Conversation
This was referenced Aug 13, 2026
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.
Why
After a contributor chooses Discard this ticket to its base from a failed Revert, the discard succeeds but the old red patch error remains on screen. The checkout is clean, yet the interface still claims the operation failed.
The original #325 belonged to the stale stack that GitHub closed while #324 was being recovered, so this PR lands the already approved fix directly on
trunk.What changes
After a successful discard, clear the stale apply error and related preview state. If discard fails, retain all of that state so the contributor can still understand and recover from the failure.
How to test this
Platforms: macOS and Windows.
Starting state: ticket #65819 linked, PR #13017 applied, with this contributor edit on an applied line in
tests/phpunit/tests/customize/widgets.php:What must not have happened:
This flow passed in the approved integration artifact at commit
012d7dfon macOS and Windows.Risks and limitations
The final Git tree is exactly the tree manually approved for the release candidate. Self-review: 0 [fix here] · 0 [follow-up].
Related
Replacement landing for #325. Follow-up to #318 and #330.
Design decisions and alternatives considered
The cleanup is derived in the existing pure reducer and only committed after
outcome.ok. Keeping failure state unchanged avoids hiding recovery information after an unsuccessful destructive operation.A standalone PR avoids reusing the closed stack topology that caused #324 not to land on
trunk.Review outcome (required — see AGENTS.md)
0 [fix here] · 0 [follow-up]. Lint, 1010/1010 tests, and
git diff --checkpass. The branch resolves to approved treed3904782d5e434df8591e99d3ccf2a49a52ebcc9.Implementation notes
Recovery head before squash:
6a88a26. It contains one commit directly on #330's squash commit.Screenshots or recording
The user-visible flow was manually validated on both target platforms in the approved integration artifact.