Fix use cache prerender signal retention - #97476
Conversation
Failing test suitesCommit: 7cb0c7f | About building and testing Next.js
Expand output● Image Component Tests › SSR Image Component Tests › should render an image tag ● Image Component Tests › SSR Image Component Tests › should support passing through arbitrary attributes ● Image Component Tests › SSR Image Component Tests › should modify src with the loader ● Image Component Tests › SSR Image Component Tests › should correctly generate src even if preceding slash is included in prop ● Image Component Tests › SSR Image Component Tests › should add a srcset based on the loader ● Image Component Tests › SSR Image Component Tests › should add a srcset even with preceding slash in prop ● Image Component Tests › SSR Image Component Tests › should use imageSizes when width matches, not deviceSizes from next.config.js ● Image Component Tests › SSR Image Component Tests › should support the unoptimized attribute ● Image Component Tests › SSR Image Component Tests › should not add a srcset if unoptimized attribute present ● Image Component Tests › SSR Image Component Tests › should keep auto parameter if already set ● Image Component Tests › SSR Image Component Tests › should keep width parameter if already set ● Image Component Tests › SSR Image Component Tests › should keep fit parameter if already set ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image with preceding slash ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image, with arbitrary host ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image, with quality ● Image Component Tests › SSR Image Component Tests › should not create any preload tags higher up the page than CSS preload tags ● Image Component Tests › SSR Image Component Tests › should add data-nimg data attribute based on layout ... truncated ...
Expand output● Custom Resolver Tests › SSR Custom Loader Tests › Should use a custom resolver for image URL ● Custom Resolver Tests › SSR Custom Loader Tests › should add a srcset based on the custom resolver ● Custom Resolver Tests › SSR Custom Loader Tests › should support the unoptimized attribute ● Custom Resolver Tests › Client-side Custom Loader Tests › Should use a custom resolver for image URL ● Custom Resolver Tests › Client-side Custom Loader Tests › should add a srcset based on the custom resolver ● Custom Resolver Tests › Client-side Custom Loader Tests › should support the unoptimized attribute
Expand output● Image Component Tests › SSR Image Component Tests › should render an image tag ● Image Component Tests › SSR Image Component Tests › should support passing through arbitrary attributes ● Image Component Tests › SSR Image Component Tests › should modify src with the loader ● Image Component Tests › SSR Image Component Tests › should correctly generate src even if preceding slash is included in prop ● Image Component Tests › SSR Image Component Tests › should add a srcset based on the loader ● Image Component Tests › SSR Image Component Tests › should add a srcset even with preceding slash in prop ● Image Component Tests › SSR Image Component Tests › should use imageSizes when width matches, not deviceSizes from next.config.js ● Image Component Tests › SSR Image Component Tests › should support the unoptimized attribute ● Image Component Tests › SSR Image Component Tests › should not add a srcset if unoptimized attribute present ● Image Component Tests › SSR Image Component Tests › should keep auto parameter if already set ● Image Component Tests › SSR Image Component Tests › should keep width parameter if already set ● Image Component Tests › SSR Image Component Tests › should keep fit parameter if already set ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image with preceding slash ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image, with arbitrary host ● Image Component Tests › SSR Image Component Tests › should add a preload tag for a priority image, ... truncated to fit in one GitHub comment ... |
Stats from current PR🔴 1 regression, 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
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (33 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsfailed to diffapp-route-ex..ntime.dev.jsDiff too large to display app-route-ex..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route.runtime.dev.jsDiff too large to display app-route.ru..time.prod.jsDiff too large to display dev-validati..ntime.dev.jsfailed to diffdev-validati..ntime.dev.jsfailed to diffdev-validati..ntime.dev.jsfailed to diffdev-validati..ntime.dev.jsfailed to diffpages-api-tu..ntime.dev.jsDiff too large to display pages-api-tu..time.prod.jsDiff too large to display pages-api.runtime.dev.jsDiff too large to display pages-api.ru..time.prod.jsDiff too large to display pages-turbo...ntime.dev.jsDiff too large to display pages-turbo...time.prod.jsDiff too large to display pages.runtime.dev.jsDiff too large to display pages.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display 📎 Tarball URLCommit: 7cb0c7f |
Summary
After a fallback-shell cache prerender completes, snapshot whether its timeout fired and then abort the existing timeout controller when it participates in an
AbortSignal.any()composite. This triggers the composite so React removes its abort listener; no additional controller or signal is needed. Cache prerenders without a dynamic-access source keep their existing direct timeout signal.Node retains non-empty composite abort signals while they have abort listeners. React attaches such a listener during
prerender()and removes it when the signal aborts, so aborting the already-owned timeout source releases the successful render. SnapshottingdidTimeoutfirst keeps cleanup aborts distinct from real timeouts.This preserves the early aborted-prerender guard from #96426, which prevents a cache fill that starts after its outer prerender aborts from caching an empty React stream.
Fixes #97363
Related #97464
Alternative to #97391
Verification
pnpm --filter=next buildpnpm test-start-turbo test/e2e/app-dir/use-cache-after-uncached-io/use-cache-after-uncached-io.test.tspnpm test-start-turbo test/e2e/app-dir/use-cache-hanging/use-cache-hanging.test.tsprerender()GC probe on Node 20.19.5 and 22.20.0: valid preludes, no cleanup errors, and 0/100 composite signals retained while their source controllers remained reachable.