Repository navigation
Keep saved plugin settings visible across separate query notifications - #7714
Merged
Merged
Conversation
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.
Human comments
What was wrong
Plugin settings could briefly revert a successfully saved text value when React received mutation completion before the refreshed settings query. The field synchronized from its still-old props after the pending flag cleared. This also explains the intermittent autosave assertion that expected the new text but received the previous value.
What changed
Use the successful mutation response while the field is waiting for refreshed props. Once the stored value changes, that external value takes precedence. Existing guards preserve a newer unsaved draft and failed-save state.
How you verified
The existing autosave test now releases actual TanStack notifications one React commit at a time. It fails against the old implementation and passes with the fix, then checks external updates and preservation of unsaved text. All 33 affected component/query cases pass, including the 20 settings cases, along with 7 Turbo lint/typecheck tasks.
A real browser against an isolated source app reproduced the old-value rollback across 12 separately delivered notification callbacks. The identical schedule keeps the saved value visible after the fix. Browser input also verified a newer draft during a held PUT, a second blur/save, HTTP 503 failure with the draft retained, retry, and persistence after reload. API and matching source CLI reads agree with the visible saved value.
The complete integration branch containing this and the related flake repairs passed the unchanged native CI workflow: 47 successful jobs and one skipped job. This uses normal Turbo cache reuse; it is not a claim that every task reran from scratch. The earlier standalone PR run failed in the secondary-panel readiness case repaired by #7684. That fix is now merged into main and included in this branch; fresh standalone CI passes.