A stale blocker answer after a push makes the next Back change the URL without updating the router
Maintainer thường phản hồi trong vòng 1 ngày
@cgalo đang làm issue này rồi.
Từ ngày 8/11/2026.
Đá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
- 56/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start with the linked StackBlitz reproducer and trace how the router handles an async blocker answer after a push replaces pending navigation. Inspect the history and blocker code paths around go(+1) and ignoreNextPop, then run the relevant router history and blocker tests. Done means the stale “stay” answer has no effect on the next Back, and the URL and router both reach /first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which project does this relate to?
Router
Describe the bug
If a push happens while an async blocker is still waiting on a Back, and the old blocker is then answered "stay", the next Back changes the URL but the router never hears about it. The URL and the router stay out of sync.
It looks like the stale answer calls go(+1) after the push has removed forward history, so no popstate arrives and ignoreNextPop stays set for the next real Back.
Complete minimal reproducer
https://stackblitz.com/edit/er7zmjvu?file=src%2Fmain.jsx
Steps to Reproduce the Bug
Click the buttons in the preview, in order:
- Setup: go to
/first, then/second - Back. The blocker waits.
- Push
/newwithignoreBlocker: true - Answer the old blocker: stay
- Back
The blocker:
useBlocker({
shouldBlockFn: () => new Promise((resolve) => { answer.current = resolve }),
enableBeforeUnload: false,
withResolver: false,
})
Result after step 5: URL /first, router /new.
Expected behavior
After step 5, the URL and the router are both on /first.
Edit: After step 5 the still-mounted blocker asks again. While it waits, the URL is /first and the router is /new. Leaving puts both on /first. Staying still leaves them apart (index drift, not fixed by the linked PR).
An answer from a blocker that a push already replaced should have no effect on later navigation.
Platform
- Router / Start Version:
@tanstack/react-router1.170.45,@tanstack/history1.162.5 - OS: Linux
- Browser: Chrome. Firefox also shows it with
createBrowserHistorydirectly. - Browser Version: 154.0.8037.92
- Bundler: vite
- Bundler Version: 7.2.2
Additional context
Not the same as #8844, which is about __TSR_index on push/replace.
Written with AI assistance. The steps above were run in a browser against the linked project. Happy to send a PR if that helps.
- Ngôn ngữ chính
- TypeScript
- Star
- 15.3k
- Fork
- 1.9k
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- 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/router
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')Có thể đã có người làm @hassanabrar202 đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)Có thể đã có người làm @Sheraff đã nhận 27 ngày trước. Đang mởpackage: router-generator performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiersCó thể đã có người làm @Sheraff đã nhận 27 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(router): clarify static title fallback in SPA modeCó thể đã có người làm @Rohan-Dedhia đã nhận 18 ngày trước. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/router
Issue tương tự
-
[BUG]: Shared links drop the configured basePath on GitHub PagesCó thể đã có người làm @anshulchikhale30-p đã nhận hôm nay. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: GTrekkerĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ui Bug Payload OSS
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
payloadcms/payload#19839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
Maintainer thường phản hồi trong vòng 1 ngày