Skip to content

Commit 8b786c8

Browse files
committed
fix: report the uncommitted swap without changing the pipeline
The previous commit returned early on the four non-committing applySwap paths, which also skipped the history push, the scroll block, and the streaming tail those paths used to fall through to. A click-driven frame nav records history, so a frame-missing response would have stopped advancing the URL. Nothing covers that, so the absence of a red test was not evidence. It is a flag now, so only the reported value changes.
1 parent d2f80bd commit 8b786c8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/core/src/router-client.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,7 +3170,14 @@ async function fetchAndApply(href, frameId, recordHistory, optimisticState, meth
31703170
// importmap/build mismatch, a poisoned boundary scan). The page is not left
31713171
// in a bad state either way, but nothing was applied IN PLACE, and `applied`
31723172
// has to say so or it repeats the hole it exists to close.
3173-
if (disposition === 'none') return { ok: respOk, status: respStatus, aborted: false, applied: false };
3173+
//
3174+
// Recorded as a FLAG rather than returned early on purpose. These paths used
3175+
// to fall through to the history push, the scroll block, and the streaming
3176+
// tail, and an early return would silently change all three (a click-driven
3177+
// frame nav records history, so a frame-missing response would stop advancing
3178+
// the URL). This commit is about what the outcome REPORTS, not about what the
3179+
// pipeline does, so the fall-through is left exactly as it was.
3180+
const applied = disposition !== 'none';
31743181
// A discarded revalidation must be discarded OUTRIGHT: a streamed response's
31753182
// boundary templates must not splice into the restored snapshot afterward
31763183
// (boundary ids are per-render sequential, so a reduced render's numbering
@@ -3228,7 +3235,7 @@ async function fetchAndApply(href, frameId, recordHistory, optimisticState, meth
32283235
}
32293236

32303237
document.dispatchEvent(new CustomEvent('webjs:navigate', { detail: { url: finalUrl, frameId, from: 'navigate' } }));
3231-
return { ok: respOk, status: respStatus, aborted: false, applied: true };
3238+
return { ok: respOk, status: respStatus, aborted: false, applied };
32323239
} finally {
32333240
// Clear the frame's busy state on every exit path (the early returns
32343241
// above all unwind through here). No-op when this was not a frame nav.

0 commit comments

Comments
 (0)