An older navigation can overwrite the URL after a newer navigation commits
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, playwright, typescript
调研方向
Read packages/void/src/pages/navigation-engine.ts around makeCommit() and packages/void/src/pages/client.ts around applyNavigationResource(). Run the reported parallel-integration Playwright test and inspect how it controls adapter update timing. Add regression coverage for both completion orders and the normal-navigation control; done means a superseded navigation cannot change the URL, head, scroll, or Deferred ownership, and the reproduction leaves both page and URL at /b.
由索引模型根据 Issue 内容生成。
描述
Description
An earlier navigation can commit its URL after a later navigation has already rendered and committed. This leaves the displayed page and browser URL pointing to different destinations.
Unlike #506, this occurs with default navigation options, without preserveState: true.
Environment
- Commit:
2ceab89154dc6e0c3fa5525f7bd4d1d5f3d0aa64 - Package version:
1.1.12 - OS: Ubuntu 24.04.3 LTS x86_64
- Node:
24.21.0 - Vite+:
1.3.0; Vitest:5.0.5 - Playwright:
1.64.1 - Chromium Headless Shell:
134.0.6998.35
Steps to reproduce
- Initialize the production
createVoidRouter()in a browser fixture with valid Pages responses for/aand/b, with View Transitions disabled. - Provide an adapter whose
applyUpdate()updates the displayed page but returns a controllable Promise for/a:
let releaseA!: () => void;
let enteredA!: () => void;
const gate = new Promise<void>(resolve => {
releaseA = resolve;
});
const entered = new Promise<void>(resolve => {
enteredA = resolve;
});
const adapter = {
// Other adapter methods omitted.
applyUpdate(pageData: { url: string }) {
document.getElementById('app')!.textContent = pageData.url;
if (pageData.url === '/a') {
enteredA();
return gate;
}
},
};
- Start navigation A, allow B to finish, and then release A:
const visitA = router.visit('/a');
await entered;
await router.visit('/b');
releaseA();
await visitA;
- Compare the displayed page with
window.location.pathname.
Actual behavior
The older navigation overwrites the URL after the newer navigation has committed:
| Value | Result |
|---|---|
| Displayed page | /b |
window.location.pathname |
/a |
A newly added Playwright integration test reproduced this in both runs. The normal-navigation control passed in both runs.
The test was executed through the repository's parallel-integration project:
vp test run packages/void/test/integration/pages-navigation-race.test.ts --project parallel-integration
The fixture serves the production Pages client through a local HTTP server and controls the adapter's update timing. This verifies the Core/browser race; it is not a full production-build test across every framework adapter.
Expected behavior
The displayed page and browser URL should both remain /b.
Once B has superseded A and committed, completing A's pending adapter update should not allow A to commit its URL or other navigation side effects.
Relevant implementation
In packages/void/src/pages/navigation-engine.ts, makeCommit() uses the pending resource ID when clearing pending state, but that check does not guard the remaining commit operations.
applyNavigationResource() in packages/void/src/pages/client.ts awaits the adapter update and then calls resource.commit(). Consequently, the older resource can still reach the history-writing path after the newer resource has committed.
Acceptance criteria
- A superseded navigation cannot overwrite the URL after a newer navigation commits.
- The reproduction above leaves both the displayed page and URL at
/b. - A superseded commit does not overwrite the newer page's head, scroll, or Deferred resource ownership.
- Regression coverage includes controlled adapter-update completion orders and a normal-navigation control.
- 主要语言
- TypeScript
- 星标
- 402
- 派生
- 32
- 平均合并
- 11 小时 52 分钟
- 30 天内合并 PR
- 88
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
voidzero-dev/void 的其他 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 78/100
voidzero-dev/void#428 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
voidzero-dev/void#511 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
voidzero-dev/void#510 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 58/100
voidzero-dev/void#509 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
voidzero-dev/void#506 ·
维护者通常 1 天内回复
查看 voidzero-dev/void 的全部 Issue
相似的 Issue
-
area: repo priority: P2 type: bug
难度 2/5 1-3 小时 新手友好度 76/100
appandflow/stim#4107 · 1 条评论 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1-3 小时 新手友好度 60/100
lingdojo/kana-dojo#32859 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
code-quality refactoring
难度 2/5 1-3 小时 新手友好度 78/100
github/gh-aw-firewall#10364 ·
维护者通常 1 天内回复
-
Merge the duplicate kaffir_corn record into sorghum可能已有人在做 @Crypto-Shroom 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
Crypto-Shroom/Bird-Feed-Calculator#322 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
drizzle-team/drizzle-orm#6552 ·
维护者通常 2 天内回复