Skip to content

fix(signals): an Errored heals when nothing reads the failed source any more (#4644) - #4653

Merged
ryansolid merged 6 commits into
nextfrom
claude/fix-4644-errored-stuck
Nov 3, 2026
Merged

ryansolid merged 6 commits into
nextfrom
claude/fix-4644-errored-stuck

Conversation

@ryansolid

@ryansolid ryansolid commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

What was wrong

An error boundary waits on the source that threw (StatusError.source), and prune kept a reader while that source was still errored. When the error reached the boundary only through memos (a <Show when> / <Match when> condition, a memo of the condition, a keyed Show), the reader the boundary caught was its own tree. Navigating to another branch disposed every memo that read the failed source and the tree re-ran clean, but the source (owned outside the boundary) was still errored, so prune kept the tree forever and the fallback stayed up. A render-effect reader recovered only because it was disposed (#4373's path).

The first version of this PR asked whether anything still subscribed to the source. That left the same bug when something outside the boundary still reads it: a memo hoisted above the <Errored>, a derived store or createProjection built from it, or a reader under a different <Errored> (a header count). None of those caught this boundary's error, but each kept the fallback up. next behaves the same way.

Rule

D-39's heal clause: "A fallback that no live reader holds heals: the boundary waits on what threw only while a reader that caught the error is alive, so when the last one is disposed … the content shows again — what a fresh render with the same inputs shows, since nothing on it reads the error." F-3: a reader that is no longer the display holds nothing. F-12: the error fallback is a fallback. The neighbouring D-39 cases are unchanged: a re-ask of the errored source, or a pending read directly under the <Errored>, keeps the error up until its answer, and a recovery held in an action reveals with its hold (D-41).

Change

prune (packages/signals/src/boundaries.ts): the errored or pending source keeps an error boundary's reader only while that reader still reads it, directly or through derivations wherever they live (a hoisted memo, a derived store's derive, a loading boundary's output). A small reads(r, s) walks the reader's deps. The reader's own status still keeps it, as before. A reader under another boundary, or a derivation that only something outside this boundary reads, no longer counts. For loading boundaries the reader and the source are the same node, so the walk never runs there.

Size: the first version was +8 B minified (not +12 as this body said). This version adds the deps walk, an estimated ~+60–80 B minified in the boundaries chunk (well above 20 B; see the CI size report for the real numbers). The walk is only in the boundaries chunk, so the core path and hello world should not change. It runs only for an error boundary's reader whose own status has cleared while its source is still errored or pending, and it stops at the first path to the source.

Tests

  • packages/signals/tests/errored-heal-memo-reader-4644.test.ts: memo-only reader, effect reader, and a "kept" row where another live reader under the boundary keeps the error up. New rows read the failed source through a hoisted memo, a derived store, a projection, a reader under another error boundary, and a sync throw through a hoisted memo. Each keeps the error while the list is mounted, including after another reader settles and triggers a prune, and heals when you navigate away. The other-boundary row keeps its own fallback, and the sync row shows the error again when you navigate back. All five new rows fail on the previous head.
  • packages/web/test/errored-heal-memo-reader-4644.spec.tsx: the issue's matrix (Show condition, Show of rows, keyed Show, Switch/Match, memo of the condition, text, For), with and without <Loading>. New rows: a derived memo outside the <Errored>, a derived store outside it, and a header reader under another <Errored>.
  • Existing: the signals error, boundary, recovery, loading and reveal tests (82 files, 605 passed, 12 expected fail), and the web Errored heal, recovery and retry specs.

Fixes #4644.

https://claude.ai/code/session_0117BoWNSSgtemsSYsaX2hXE


Generated by Claude Code

…ny more (#4644)

An error boundary waits on the source that threw. When the reader it caught
was its own tree (the error reached it only through memos, e.g. a Show/Match
condition), the tree re-ran clean after navigating away but prune kept it
because the source itself was still errored. A source read by nothing now
settles: no live reader holds the error (D-39, F-3, F-12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWNSSgtemsSYsaX2hXE
@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3f8be1d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@solidjs/signals Patch
test-integration Patch
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
solid-js Patch
@solidjs/universal Patch
board-example Patch
canvas-example Patch
server-dbmon-example Patch
todos-server-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.42 KB 0 B 0 B −91 B 7.43 KB ✅
signals: + createStore 15.01 KB 0 B 0 B 0 B 15.03 KB ✅
signals: + isPending/latest 11.90 KB 0 B 0 B 0 B 11.92 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.05 KB 0 B 0 B −84 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.80 KB 0 B 0 B −150 B 9.80 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 19.01 KB +56 B (+0.3%) +140 B +140 B 18.97 KB ❌ over by 42 B lazy-page.js 0.04 KB
app: hydrating + every store primitive family 33.06 KB +97 B (+0.3%) +144 B +144 B 32.98 KB ❌ over by 83 B lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.68 KB +44 B (+0.3%) +140 B +140 B 13.65 KB ❌ over by 25 B lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.41 KB +18 B (+0.1%) +140 B +140 B 15.41 KB ❌ over by 4 B lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 30.07 KB +58 B (+0.2%) +140 B +140 B 30.03 KB ❌ over by 40 B lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.97 KB 0 B 0 B −187 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.54 KB +12 B (+0.0%) +140 B +140 B 26.54 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.77 KB +10 B (+0.0%) +141 B +141 B 32.79 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 33.99 KB +55 B (+0.2%) +140 B +140 B 33.95 KB ❌ over by 37 B assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.22 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 39.89 KB −16 B (−0.0%) +140 B +140 B 39.92 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.24 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 36.02 KB +109 B (+0.3%) +140 B +140 B 35.93 KB ❌ over by 88 B assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.17 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 44.02 KB +63 B (+0.1%) +140 B +140 B 43.97 KB ❌ over by 52 B eager (counted): web.js 23.50 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.22 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.55 KB +106 B (+0.3%) +146 B +146 B 41.53 KB ❌ over by 15 B assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.58 KB, trace.js 9.20 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 49.70 KB +89 B (+0.2%) +140 B +140 B 49.63 KB ❌ over by 67 B eager (counted): client.js 28.67 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.22 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.86 KB 0 B 0 B 0 B 22.87 KB ✅

❌ Fails the gate

  • app: hydrating (no stores) with Show/For/Loading/Errored/lazy: over brotli cap by 42 B; minified 54,046 B vs 53,906 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • app: hydrating + every store primitive family: over brotli cap by 83 B; minified 99,595 B vs 99,451 B recorded with the cap (+144 B) — 124 B past the 20 B minified allowance; +144 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • app: CSR with Show/For/Loading/Errored/lazy: over brotli cap by 25 B; minified 37,517 B vs 37,377 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • app: CSR, observe tier (same app on the observe artifacts): over brotli cap by 4 B; minified 42,467 B vs 42,327 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • app: CSR, observe tier + attribution engine enabled: over brotli cap by 40 B; minified 88,796 B vs 88,656 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • page: base server components (hydrating + dynamic + frames + sf reference): over brotli cap by 37 B; minified 102,166 B vs 102,026 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread): over brotli cap by 88 B; minified 108,500 B vs 108,360 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • page: compiled live server components (the compiled base page + live/GET + action + isPending/latest): over brotli cap by 52 B; minified 128,496 B vs 128,356 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 15 B; minified 126,254 B vs 126,108 B recorded with the cap (+146 B) — 126 B past the 20 B minified allowance; +146 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 67 B; minified 146,057 B vs 145,917 B recorded with the cap (+140 B) — 120 B past the 20 B minified allowance; +140 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@coveralls

coveralls commented Nov 3, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 41606735688

Coverage remained the same at 78.205%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1369
Covered Lines: 1131
Line Coverage: 82.62%
Relevant Branches: 1104
Covered Branches: 803
Branch Coverage: 72.74%
Branches in Coverage %: Yes
Coverage Strength: 29.98 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 9.43%

2 warnings

⚠️ 3 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 2 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 2 improved benchmarks
✅ 198 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ projection derive: write one NESTED field (reference) 2.4 ms 2.1 ms +13.98%
⚡ memo + sync render effect only (reference) 33.3 ms 31.7 ms +5.06%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/fix-4644-errored-stuck (3f8be1d) with next (6f33602)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

prune kept an error boundary's reader while the source that threw was
errored and subscribed by anything at all. A memo hoisted outside the
boundary, a derived store or projection, or a reader under another
Errored kept the source subscribed, so the fallback stayed up after
every reader under the boundary was gone. D-39: the boundary waits on
what threw only while a reader that caught the error is alive. The
source now keeps the reader only while that reader still reads it,
directly or through derivations (#4644).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWNSSgtemsSYsaX2hXE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWNSSgtemsSYsaX2hXE
@ryansolid
ryansolid merged commit dd5f9d1 into next Nov 3, 2026
8 of 9 checks passed
ryansolid added a commit that referenced this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants