Skip to content
Source
Sign inSign up
TanStack/query

Query DevTools is not isolated #9681

Send to my agent
Closedfernion(GitHub profile, opens in a new tab) opened this issue 2 comments

Describe the bug

If we have multiple instances of Query DevTools, actions on one affect the other instance.

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-react-query-dev-tools-issue?file=README.md

Steps to reproduce

Open the example on the provided link

  1. Open the devtools
  2. Click on Query A and Query B to see both dev tools panels (each has its own query client)
  3. Click on a query on Query A
  4. Click on a query on Query B
    1. We see that the previous panel's details are hidden
  5. Press trigger loading (or any other query option)
    1. We see the same query details on both panels now

Expected behavior

Each query devtools should be isolated and actions in one should not affect the other one

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Brave

Tanstack Query adapter

react-query

TanStack Query version

v5.76.1

TypeScript version

No response

Additional context

No response

  1. TkDodo added labelspackage: query-devtools

  2. TkDodo added labelshelp wanted

  3. Created a PR 10006 can you take a look @TkDodo can you take a look?

  4. I have worked on this and opened PR #11798. The root cause was four module-level Solid signals in packages/query-devtools/src/Devtools.tsx shared across mounted devtools instances; the fix scopes them per instance via a new DevtoolsStateProvider context. Added isolation tests — 251/251 package tests pass, typecheck and ESLint clean.

  5. TkDodo closed this

Sign in to join this conversation.