fix(desktop): isolate MCP catalog refresh by project - #201
Merged
Conversation
Collaborator
|
Merged on 2026-09-03 as 5dfa89c. The deferred-promise regression test for the A-to-B switch was what made this easy to verify (typecheck, lint and all 195 Desktop tests green on the merged tree). Ten lines of fix, a real race, a test that pins it — this is the ideal shape for a contribution. Thank you, and welcome. |
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.
Description
Fix a project-switch race in the Desktop MCP catalog. If a probe or mutation started in project A finished after the user switched to project B, its captured refresh could increment the shared generation and invalidate the in-flight B load. The UI then remained in a loading state with no B catalog.
The hook now records the active catalog owner and ignores refreshes captured by an inactive project before they can mutate shared state.
Related Issues
No matching open issue or PR was found.
Changes Made
Checklist
Validation
Using Node
v22.23.2:npm run typechecknpm run lintwith zero warningsnpm run builduvx pre-commit run --all-filesgit diff --check