fix: cache miss in App Shell for cached pages with gSP#95665
Merged
Conversation
Contributor
Stats from current PR🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (10 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsDiff too large to display app-page-exp..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsDiff too large to display app-page-tur..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsDiff too large to display app-page-tur..time.prod.jsDiff too large to display app-page.runtime.dev.jsDiff too large to display app-page.runtime.prod.jsDiff too large to display pages-api.ru..time.prod.jsDiff too large to display pages.runtime.prod.jsDiff too large to display 📎 Tarball URLCommit: c43191e |
Contributor
Tests PassedCommit: c43191e |
lubieowoce
force-pushed
the
lubieowoce/fix-hanging-link-inputs
branch
from
July 10, 2026 00:46
5eb1f02 to
132417c
Compare
unstubbable
force-pushed
the
lubieowoce/fix-hanging-link-inputs
branch
from
July 22, 2026 11:23
132417c to
a90402e
Compare
unstubbable
marked this pull request as ready for review
July 22, 2026 13:57
Resolving `createRuntimePrerenderSearchParams` to `delayUntilStage`, to match `createRuntimePrerenderParams`, regresses the instant-validation `suspense-boundaries` tests: `delayUntilStage` drops the source code frame from the "URL data outside of Suspense" error when a page awaits `searchParams` at the top level (params, which is read via a nested component, is unaffected). We keep the `waitForStage(...).then(...)` form here and leave a TODO to align search params with params once the underlying difference in React's async I/O await tracking is understood.
The test opts into Partial Prefetching and reads a cookie in the layout so the route renders a runtime App Shell, then asserts that prefetching the shell of a `'use cache'` page with `generateStaticParams` does not log an "Unexpected cache miss after cache warming phase" warning. Before the fix, the cache-warming and final prerenders disagreed on whether params were a hanging input, so their cache keys differed and the warning fired.
The App Shell fix hangs `searchParams` in the prospective (cache-warming) runtime prerender so they become hanging inputs, matching the final prerender. A `use cache: private` that reads `searchParams` then could not finish filling during warming, so the prospective render's `cacheReady` never resolved and the App Shell prefetch request hung until it timed out. `makeHangingParams` already handles this through `fallbackParamsProxyHandler`: when its hanging promise is awaited while a cache key is being encoded (`dynamicAccessAsyncStorage` is set), it aborts the controller so the surrounding `use cache` bails out to a dynamic hole instead of running its body against a never-resolving promise, and it re-wraps the promise returned from `.then`/`.catch`/`.finally` so promises derived from `params` and passed into a cache behave the same way. `makeHangingSearchParams` only annotated the dynamic access, so a cache reading `searchParams` (directly or via a derived promise) hung. We now mirror the params proxy for `searchParams`. This is covered by the `in a private cache includes search params` case in `prefetch-runtime.test.ts`.
unstubbable
force-pushed
the
lubieowoce/fix-hanging-link-inputs
branch
from
July 22, 2026 13:58
837aebc to
c43191e
Compare
gnoff
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we're prerendering an App Shell, then url data is excluded (i.e. we don't advance beyond the
ShellRuntimestage). however the prospective prerender was still letting params/searchParams resolve, so if those ended up being inputs to a page, they wouldn't be hanging inputs, and we'd get a cache miss for them in the final prerender.closes NAR-883