mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #1102] fix(router): gate refresh and traverse outcomes #1096
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#1096
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/1102
Author: @NathanDrake2406
Created: 5/6/2026
Status: 🔄 Open
Base:
main← Head:nathan/issue-726-lifecycle-refresh-prefetch-traverse📝 Commits (1)
507ffe6fix(router): gate refresh and traverse outcomes📊 Changes
8 files changed (+322 additions, -24 deletions)
View changed files
📝
packages/vinext/src/server/app-browser-entry.ts(+4 -2)📝
packages/vinext/src/server/app-browser-navigation-controller.ts(+11 -13)📝
packages/vinext/src/server/app-browser-state.ts(+10 -0)📝
packages/vinext/src/server/app-browser-visible-commit.ts(+9 -2)📝
packages/vinext/src/shims/navigation.ts(+10 -3)📝
packages/vinext/src/shims/next-shims.d.ts(+23 -1)📝
tests/app-browser-entry.test.ts(+203 -2)📝
tests/prefetch-cache.test.ts(+52 -1)📄 Description
What changed
Implements #726-CORE-05/06A and #726-CORE-06B from issue #726.
Why
Issue #726 calls out a class of stale async navigation results where an older operation can resolve after a newer visible commit. The previous gate only checked the active navigation id. That was not enough for operations such as refresh and traverse, because a newer visible commit can occur without changing the same operation token. The existing pending operation shape already captured startedVisibleCommitVersion, so this patch uses that value as the lifecycle boundary.
For prefetch, the required outcome is cache seed only. The cache entry now stays pending until the response snapshot is actually consumable, and prefetch still never calls the visible navigation entry point.
Validation
Non-goals
Bonk: please read issue #726 for the big picture before reviewing this patch. The lifecycle-gate work here is one slice of that larger router determinism plan.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.