Devtools panel freezes the page for minutes when the query cache holds thousands of observed queries
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, typescript
- Ambito
- devtools, frontend, performance
Direzione di ricerca
Inizia dal percorso di mounting del pannello DevTools descritto nella riproduzione e analizza come le query e le mutation memorizzate nella cache diventano righe. Traccia le sottoscrizioni alla cache usate dai riquadri dei dettagli e dai badge di stato, incluse le scansioni complete ripetute della cache e gli eventi della cache. Usa il CodeSandbox collegato con migliaia di query osservate; il lavoro è completato quando l’apertura del pannello e il fatto di lasciarlo aperto non causano più un blocco percepibile del thread principale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Opening the devtools against a QueryClient holding a few thousand queries blocks the main thread for minutes. The tab stops responding entirely — no scrolling, no clicks, no animation — and stays that way until the panel finishes mounting.
The panel renders one row per cached query and per cached mutation with no windowing, and each row registers several cache subscriptions, so the work done on open scales with the size of the cache rather than with what is visible. Several subscriptions also walk the whole cache on every cache event: the details panes resolve their selected item by scanning until they find a match, and the status badges count the entire cache once per status. Nothing throttles that, and each setQueryData emits two cache events, so an application that is still loading data keeps the panel re-doing all of it.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/brave-microservice-8kltf4
Steps to reproduce
- Open the example and let the list build for a few seconds.
- Press Open the devtools.
- Try to scroll the page. Nothing responds — the spinner stops and scrolling and clicks do nothing. The page stays frozen for minutes.
- When it recovers, the readout under the spinner reports the longest unbroken freeze.
Expected behavior
Opening the devtools should not block the main thread for a noticeable period, and keeping it open should not make the application unresponsive.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: Windows 11
Browser: Edge
Version: 151.0.4129.59
Tanstack Query adapter
react-query
TanStack Query version
v5.101.4
TypeScript version
v5.9.2
Additional context
No response
- Lingua principale
- TypeScript
- Stelle
- 50.4k
- Fork
- 4.2k
- Merge medio
- 7h 29m
- PR unite (30g)
- 393
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Forse di nuovo libera @LeonxLJX l’ha presa 33 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TanStack/query#11358 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)Forse già presa @MaNaN1803 l’ha presa 76 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TanStack/query#11106 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
restoreQueries and persisterGc throw on malformed persisted entriesForse già presa @VGontier-cmd l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
setQueryData: NoInfer loses discriminated-union members when spreading a narrowed updater valueForse già presa @iosayin l’ha presa 3 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TanStack/query
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
kind/chore priority/must
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sidereal-io/sidereal#380 ·
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
opfab/operatorfabric-core#10653 ·
I maintainer di solito rispondono entro 1 giorno
-
backend bug size:sm
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
chrisbenincasa/tunarr#2237 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 Mezza giornata Idoneità per principianti 69/100
Lam30ne/regulate-app#39 ·