fix(query-devtools): isolate state per devtools instance#11112
Open
g1mn wants to merge 1 commit into
Open
Conversation
Contributor
📝 WalkthroughWalkthroughDevTools UI signals and cache subscription maps are moved into an instance-scoped Solid context. Components consume that context, providers are added to the render tree, and tests verify independent selection, resizing, and offline state across multiple instances. ChangesDevTools instance isolation
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Devtools
participant DevtoolsInstanceProvider
participant DevtoolsImpl
participant QueryClient
Devtools->>DevtoolsInstanceProvider: create instance-scoped state and maps
DevtoolsInstanceProvider->>DevtoolsImpl: provide instance context
DevtoolsImpl->>QueryClient: register cache subscriptions
QueryClient-->>DevtoolsImpl: send cache updates through instance maps
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Module-level SolidJS signals and cache maps were shared across all mounted devtools, so selecting a query, resizing, or toggling offline in one instance leaked into another. Move them into a per-instance context provider so each devtools tree owns its own reactive state and cache batching. Closes TanStack#9681
g1mn
force-pushed
the
fix/devtools-instance-isolation
branch
from
July 23, 2026 14:56
c5a459d to
adfd798
Compare
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.
Summary
Multiple Query DevTools instances (e.g. attached to different
QueryClients) shared UI state because selection, panel width, offline toggle, and cache maps lived in module-level signals. Selecting a query, resizing, or toggling offline in one panel leaked into the other (#9681).This moves that state into a
DevtoolsInstanceContextprovider so each mounted devtools tree gets its own isolated reactive state and cache batching. Exported component signatures are unchanged.Test
Added
DevtoolsInstanceIsolation.test.tsx:Existing devtools tests pass; changeset included (patch,
@tanstack/query-devtools).Closes #9681
Independently cross-reviewed with a second AI model before submission.
Summary by CodeRabbit
Bug Fixes
Tests