Uh oh!
There was an error while loading. Please reload this page.
fix(query-devtools): isolate state across multiple mounted instances - #11116
fix(query-devtools): isolate state across multiple mounted instances#11116alishoja88 wants to merge 1 commit 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. FixesTanStack#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)
📝 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 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
Suggested labels: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
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