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 49a765c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(signals): a boundary's fallback is instantiated once per show (#3992)
* fix(signals): a boundary's fallback is instantiated once per show (#3991)
The fallback was built inside the boundary's output pass, so every
re-derive of the output while it showed rebuilt it: a sibling verdict
reader re-running on the error re-ran the tree, which threw the same
error again and re-derived the output (two fallbacks for one failure);
a reset() whose retry was pending re-derived it through prune (a third);
the Retry button was replaced and focus lost. Build the fallback in a
computed of its own beside the output, with the output's id, and keep it
while the fallback shows; dispose it when content shows. A later error
reaches it through the error accessor, as intended all along (the
once-per-show pin in createErrorBoundary.test.ts held for a render
effect erroring directly, not for a memo between).
Size-Exception: CSR with Show/For/Loading/Errored 12.976 -> 12.99 KB,
observe-tier CSR 14.56 -> 14.59 KB, compiled CSR 25.465 -> 25.49 KB
(+146 B minified each); core, isPending/latest and render unchanged.
Accepted by the maintainer 2026-10-12.
Fixes#3991
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LVm3wseHt9wRTY8LfPiHmQ
* fix(signals): dispose the fallback once the content that replaces it is on screen
A held swap to content keeps the fallback on screen, live, until the
commit (S-14): the disposal is a queued run — this flush's effect phase
when the pass is the frame's, the landing when the frame parks — and a
pass back to the fallback before then finds it still built and keeps it.
Pinned on the S-14 shape; fails with an immediate dispose.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LVm3wseHt9wRTY8LfPiHmQ
---------
Co-authored-by: Claude <[email protected]>
A boundary's fallback is instantiated once per show. An `<Errored>` whose content reads a failing async memo through a `<Show>` rendered its fallback twice for one failure and rebuilt it when a `reset()` retry failed again, losing focus on the Retry button (#3991). The fallback is now built in a scope of its own beside the boundary's output and kept while it shows; a later error reaches it through the error accessor. The same holds for a `<Loading>` fallback across the boundary's re-derives.
Copy file name to clipboardExpand all lines: packages/signals/docs/RULES-DERIVED.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,9 +328,9 @@ The optimistic world is the screen plus the action's guesses: derivations of a g
328
328
329
329
**From:** F-12, F-3, F-1. **Scenarios:** S-38.
330
330
331
-
An `<Errored>` flipping to its fallback is a boundary going back to its fallback: the nodes behind it stop holding (unless read elsewhere, where they error too), and non-errored nodes that lose their only visible consumer that way stop holding as well. The error stays on screen until a new answer replaces the errored one — a pending is not a value: over `Errored > Loading(never shown)`, a write publishes beside the old error (`0 | Fetch error for 0` → `1 | Fetch error for 0` → `1 | Fetch error for 1`); the inner fallback is hidden behind the error. `Errored` builds its function fallback in its own scope, like `Show`.
331
+
An `<Errored>` flipping to its fallback is a boundary going back to its fallback: the nodes behind it stop holding (unless read elsewhere, where they error too), and non-errored nodes that lose their only visible consumer that way stop holding as well. The error stays on screen until a new answer replaces the errored one — a pending is not a value: over `Errored > Loading(never shown)`, a write publishes beside the old error (`0 | Fetch error for 0` → `1 | Fetch error for 0` → `1 | Fetch error for 1`); the inner fallback is hidden behind the error. `Errored` builds its function fallback in its own scope, like `Show`, once per show: a re-derive of the boundary while the fallback shows — a second reader caught, the same error propagated again, a retry pending after `reset()`, a later error — keeps the built fallback, its DOM and focus with it; a later error reaches it through the error accessor; the fallback is disposed once the content that replaces it is on screen — at the commit, when the swap is held (#3991).
332
332
333
-
**Collapses:** §23.1 items 2–3, §27 7b (2026-10-02; the top-level `isPending(count)` affordance was lost by this ruling, knowingly), recovery 9.1–9.3. **Status:** standing.
333
+
**Collapses:** §23.1 items 2–3, §27 7b (2026-10-02; the top-level `isPending(count)` affordance was lost by this ruling, knowingly), recovery 9.1–9.3. **Status:** standing. Once per show: `tests/createErrorBoundary.test.ts` ("instantiates the fallback once per show"), `packages/web/test/errored-show-retry-3991.spec.tsx`; the held swap: `tests/boundary-fallback-held-swap-3991.test.ts`.
0 commit comments