fix(query-devtools): isolate state across multiple mounted instances - #11116
fix(query-devtools): isolate state across multiple mounted instances#11116alishoja88 wants to merge 2 commits into
Conversation
Selection, panel width, offline-mocking, and cache-subscription state lived in module-level signals/maps in Devtools.tsx, so every mounted Devtools instance (e.g. two panels bound to two different QueryClients) shared the same state. Selecting a query, resizing, or notifying one client's cache leaked into every other mounted panel. Move this state into a per-instance DevtoolsUiProvider/context so each mount is fully isolated. Fixes TanStack#9681 Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (7)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughDevtools UI state and query/mutation cache subscription maps now live in per-instance Solid context. Provider wiring is updated across components and tests, with regression coverage for simultaneous panels using separate ChangesDevtools instance isolation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change isolates Devtools state per mounted instance, preventing selections, sizing, and cache notifications from leaking between panels; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant DevtoolsComponent
participant DevtoolsUiProvider
participant Devtools
participant QueryClient
DevtoolsComponent->>DevtoolsUiProvider: create instance-scoped UI state
DevtoolsUiProvider->>Devtools: provide selections and cache maps
Devtools->>QueryClient: subscribe to caches
QueryClient-->>Devtools: update the instance's cache data
Possibly related PRs
🚥 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 |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:sherif,test:knip,tes... |
❌ Failed | 5m 18s | View ↗ |
nx run-many --target=build --exclude=examples/*... |
❌ Failed | 49s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-08-22 08:56:07 UTC
|
please take a look at the failing build: |

Selection, panel width, offline-mocking, and cache-subscription state lived in module-level signals/maps in Devtools.tsx, so every mounted Devtools instance (e.g. two panels bound to two different QueryClients) shared the same state. Selecting a query, resizing, or notifying one client's cache leaked into every other mounted panel.
Move this state into a per-instance DevtoolsUiProvider/context so each mount is fully isolated.
Fixes #9681
🎯 Changes
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Tests