Devtools panel freezes the page for minutes when the query cache holds thousands of observed queries
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- react, typescript
- Lĩnh vực
- devtools, frontend, performance
Hướng nghiên cứu
Bắt đầu với đường dẫn mounting của bảng DevTools được mô tả trong phần tái hiện và kiểm tra cách các query và mutation được cache trở thành các hàng. Theo dõi các đăng ký cache được các khung chi tiết và badge trạng thái sử dụng, bao gồm cả các lần quét toàn bộ cache lặp lại và các sự kiện cache. Sử dụng CodeSandbox được liên kết với hàng nghìn query được quan sát; hoàn thành khi việc mở và giữ bảng mở không còn gây ra hiện tượng đóng băng đáng kể trên main thread.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 50.4k
- Fork
- 4.2k
- Merge trung bình
- 11 giờ 33 phút
- Pull request đã merge (30 ngày)
- 421
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TanStack/query#11358 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)Có thể đã có người làm @MaNaN1803 đã nhận 75 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TanStack/query#11106 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
setQueryData: NoInfer loses discriminated-union members when spreading a narrowed updater valueCó thể đã có người làm @iosayin đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
setQueryData updater loses discriminated-union fields when spreading inferred NoInfer dataCó thể đã có người làm @boriskozak đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
TanStack/query#11794 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/query
Issue tương tự
-
fix: txId branch of the contract-state streams drops every state after the named transactionĐang mởbot:ai-assisted status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
midnightntwrk/midnight-js#1424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mksglu/context-mode#1268 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Edit:Đang mởcheck:failed streams:edit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
iptv-org/iptv#54352 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Table] reserveSelectedRowOnPaginate=false 时表头全选包含其他页数据Có thể đã có người làm @dvd233 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tencent/tdesign-react#4416 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:widget bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
interledger/publisher-tools#894 ·
Maintainer thường phản hồi trong vòng 1 ngày