mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
e3d634e0bc
When a static fallback shell is served as-is — e.g. from a CDN in a deployed environment — the client can't hydrate from inline Flight data; it fetches the full RSC payload separately and reconstructs the initial payload on the client. During that reconstruction, the head's partiality flag was accidentally set to the head itself. Since the head is always truthy, the head was unconditionally treated as partial. This happens to be unobservable today: the only flows that reach the reconstruction are fallback-shell prerenders, where the server pessimistically marks the head partial anyway, and when Cache Components is enabled the client ignores the per-payload flag entirely in favor of response-level partiality. But we're about to rework the RSC response format so that head partiality has a single, load-bearing source of truth, so the flag needs to survive the reconstruction correctly rather than by coincidence. While auditing the payload consumers, I also fixed the payload shape check in segment prefetch generation (it used `&&` where `||` was intended, so it accepted any shape) and deleted `should-hard-navigate.ts`, which no longer has any callers on the client. Adds e2e coverage asserting that metadata survives hydrating a fallback shell page: the title is correct after hydration, the head is included in prefetched data, and a return navigation is served entirely from the cache that was populated during initial hydration. In deployed environments this exercises the client resume path, which is where the reconstruction runs.