You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c376083
Browse filesBrowse the repository at this point in the historyBrowse files
fix(solid): a rejected fragment's fresh render claims what the server sent
Hydration never asks again for an answer the server sent. When a streamed
<Loading> fragment rejects with no outcome (no <Errored> on the server
could draw the failure: the one above it was already on the wire, or
there is none), the client still renders the fragment fresh, so the
graph under the boundary is created. Now every read in that render
claims its serialized record instead of asking again:
- a read the server resolved takes its value;
- a read whose record is an error throws that error (as the server
serialized it: redacted unless markSafeError) to the nearest client
boundary through the normal path, or is an uncaught error when there
is none;
- only a read with no record at all computes (a truncated stream's refs
are dropped from the registry).
How: a rejection (the server's, or the stream cut short) now resumes the
boundary with 0 rather than false, and resumeBoundaryHydration runs every
fresh render as a served pass (`servedPass(set, adopt)`), adopting
(`_hydratingValue`) only after a rejection. A superseded render and an
asset failure do not adopt. servedPass resets its state in a `finally`,
because an uncaught error leaves the flush by throwing. Recovery is a
real input change or a client boundary's reset(), as for any hydrated
failure (#4273).
Changed expectations:
async-memo-element-4242.spec.tsx, uncontained variants and their
`-reference` twins (the generic "server render error at this position"
path, so both change together; they still compare equal):
- runs: [] for the jsx shape. `outer` adopts the server's error and
never runs. (The loaded-mode check used to expect the client to
compute the element: "jsx-41Count: 1".) The issue shape keeps
["inner"]. That run is the fixture's own: the dry run's continuation
escapes the mock Promise through a real timer and builds the inner
slot, whose memo has no owner id to adopt by.
- halted: true, done: false (were false/true in loaded mode). The
adopted error has no client boundary to reach (a <Loading> does not
catch), so it is uncaught, as on any client render. The reactive
system halts, and the halted resume never completes hydration.
- text "", afterClick undefined (were "jsx-41Count: 1"/"Count: 1", and
"nested-41"). The element came from the errored memo, so it never
renders and there is no counter to click.
- shown ["outer", ""] streamed, [""] loaded: the fallback, then nothing.
client-hydration.spec.ts, "rejected _fr resumes without hydrating
serialized children" -> "rejected _fr resumes fresh, adopting serialized
children": memo() 0 -> 7. The fresh DOM stays, but the serialized 7 is
the server's answer, so the client uses it rather than computing 0.
client-recovery-record.spec.ts (three tests): b.memo() 0 -> 7, for the
same reason. The recovery records are unchanged.
New: served-error-no-reask.spec.tsx with two parity-harness scenarios.
- nested-rejection-no-outcome: a shell <Errored> over a streamed outer
<Loading> (a resolved read, a counter) and an inner <Loading> whose
read fails on the server beside a read the server resolved. The inner
fragment rejects with no outcome. The fresh render shows the server's
error in the shell Errored, with 0 asks for either read. reset() asks
once, and the recreated graph is live (the counter clicks).
- served-error-reread: a served error mid-hydration (a slow boundary
still pending) stands with no ask. reset() is a real retry: one ask,
and it recovers while hydration still runs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
Hydration never asks again for what the server sent, even when a streamed boundary's fragment rejects with no outcome (no `<Errored>` on the server could draw the failure). The client still renders that fragment fresh, so its graph is created, but every read in it now claims its serialized record: reads the server resolved take their values, and a read whose record is an error throws that error to the nearest client boundary, or is an uncaught error when there is none. Only reads with no record, such as those cut off by a truncated stream, compute. Recovery comes from a real input change or a boundary's `reset()`, as for any hydrated failure.
0 commit comments