Skip to content

Commit ea50523

Browse files
committed
fix(octane): convert presentation hydration miss before throwing HydrationMismatch
The mismatch() method is the shared sink for all structural hydration mismatches. During presentation hydration, a structural miss should throw PresentationAdoptionMiss (allowing retry when the presentation revision updates), not HydrationMismatch (which permanently client-renders). Several callers already checked PRESENTATION_HYDRATION before calling mismatch(), but slotMismatch, branchOpen, and adopt's fragment-remainder paths did not. Adding the presentationMiss() guard inside mismatch() itself covers all current and future callers in one place.
1 parent 6263050 commit ea50523

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20210,6 +20210,7 @@ class HydrationCapability {
2021020210
* renders on the client (see HydrationMismatch), as React does.
2021120211
*/
2021220212
mismatch(loc: string | undefined, expected: () => string, actual: Node | null): never {
20213+
if (PRESENTATION_HYDRATION?.revision !== undefined) presentationMiss();
2021320214
if (process.env.NODE_ENV !== 'production')
2021420215
warnHydrationStructuralMismatch(
2021520216
loc ?? componentSourceLoc(CURRENT_BLOCK?.body) ?? CURRENT_SCOPE?.locFile,

0 commit comments

Comments
 (0)