fix(app-router): hand off zero-stale prefetches - #2801
Conversation
commit: |
|
|
/bigbonk review for issues |
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
Review —
|
|
Review posted to PR #2801. Summary of findings: No blocking issues. The fix is correct and well-scoped. In-flight handoff —
Search-agnostic PPR shell — the Verification: 71/71 prefetch-cache tests pass; |
Summary
staleTimes.dynamic: 0to the navigation that already claimed it while the request was in flightContext
The regressions appeared between the latest scheduled main baseline and the post-merge deploy suite after #2757 stopped flooring dynamic prefetch stale times.
This preserves #2757's security/correctness intent: a completed automatic prefetch whose dynamic stale time is zero is never a cache hit. The exception is an ownership transfer to the navigation already awaiting that exact in-flight request. Search-agnostic PPR shells contain no query-dependent dynamic payload and remain non-consumable by navigation.
Validation
vp check— all 2,749 files formatted; no lint/type errors across 1,202 filesvp test run tests/prefetch-cache.test.ts— 71/71 passedtest/e2e/app-dir/metadata-streaming/metadata-streaming.test.ts— 19/19 passedtest/e2e/app-dir/navigation/navigation.test.ts— 49/50 passed; only the pre-existing hash scroll-offset failure remainstest/e2e/app-dir/segment-cache/search-params/segment-cache-search-params.test.ts— 3/4 passed; the PPR search-param regression is fixed and only the pre-existing rewritten-search dedupe failure remainstwo dynamic pages with different stale times behave independentlyandreuses dynamic data up to the staleTimes.dynamic threshold; unrelated existing failures remain in those suites