Skip to content

fix(signals): clear held error on outer boundary when inner error boundary handles next error - #5269

Open
MilindChatrabhuji wants to merge 2 commits into
solidjs:mainfrom
MilindChatrabhuji:fix/nested-errored-async-5261
Open

MilindChatrabhuji wants to merge 2 commits into
solidjs:mainfrom
MilindChatrabhuji:fix/nested-errored-async-5261

Conversation

@MilindChatrabhuji

Copy link
Copy Markdown

Summary

Fixes #5261.

When an inner <Errored> boundary rethrows (is unable to handle) error 1 and the outer <Errored> catches it, and then the underlying async source settles on error 2 which the inner <Errored> does handle, the outer boundary's keeps predicate previously returned STATUS_ERROR unconditionally (b._type), keeping the outer boundary held on error 1 even after the reader under the inner boundary recovered to error 2.

Solution

  • In packages/signals/src/boundaries.ts, add erroredOf(b) to find the nearest enclosing STATUS_ERROR boundary at or above b (D-38, F-12).
  • Update keeps(b, r) for STATUS_ERROR boundaries so STATUS_ERROR is only included when erroredOf(r._context?.[BOUNDARY]) === b, allowing an outer error boundary to release its held error when the reader belongs to an inner error boundary that handled the next error.
  • Update packages/signals/docs/RULES-INDEX.md rule citation counts for F-12 and D-38.
  • Add @solidjs/signals regression tests in packages/signals/tests/nested-errored-async-5261.test.ts (sync, async rethrow -> handled -> rethrow -> recovery, and pending sibling case) and an <Errored> integration test in packages/solid/test/errored-nested-async-5261.spec.ts.
  • Add changeset .changeset/nested-errored-async-rethrow.md ("@solidjs/signals": patch).

Validation

  • @solidjs/signals: vitest run — 574/577 files passed (nested-errored-async-5261.test.ts 3/3 passed, errored-latest-loading-reask-4870.test.ts passed; the 3 failing files on Windows are environment-specific: rules-index.test.ts & treeshake.test.ts path separator checks and dist-artifacts.test.ts ENAMETOOLONG on Windows CLI arg length).
  • solid-js: vitest run — 57/60 files passed (errored-nested-async-5261.spec.ts 1/1 passed; remaining 3 files fail locally due to missing packages/universal/dist, Windows path separators in published-declarations.spec.ts, and Windows shebang transform in diagnostics-catalog.spec.ts).
  • scripts/size (gate.mjs): all non-compiler scenarios pass (page: base 34,239 B <= 34,240 B cap; page: live 41,647 B <= 41,680 B cap; app: hydrating WARN under minified allowance); the 7 compiled scenarios were skipped locally due to missing @solidjs/compiler-wasm32-wasi.

@changeset-bot

changeset-bot Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e0ab855

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

This PR includes changesets to release 5 packages
Name Type
@solidjs/signals Patch
@solidjs/web Patch
@solidjs/diagnostics Patch
solid-js Patch
@solidjs/universal 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

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.

[2.0.4] Nested <Errored>: the outer boundary stays on an error the inner one rethrew, after the next error is one the inner one handles

1 participant