Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

An older navigation can overwrite the URL after a newer navigation commits

オープン
#507 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, playwright, typescript
領域
frontend, testing

調査の方向性

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

  1. Initialize the production createVoidRouter() in a browser fixture with valid Pages responses for /a and /b, with View Transitions disabled.
  2. 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;
    }
  },
};
  1. 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;
  1. 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分
マージ済み PR(30日)
88

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/void のほかの issue

voidzero-dev/void の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。