Repository navigation
fix(signals): clear held error on outer boundary when inner error boundary handles next error - #5269
Open
MilindChatrabhuji wants to merge 2 commits into
Open
MilindChatrabhuji wants to merge 2 commits into
MilindChatrabhuji wants to merge 2 commits into
Conversation
…ndary handles next error (solidjs#5261)
🦋 Changeset detectedLatest commit: e0ab855 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'skeepspredicate previously returnedSTATUS_ERRORunconditionally (b._type), keeping the outer boundary held on error 1 even after the reader under the inner boundary recovered to error 2.Solution
packages/signals/src/boundaries.ts, adderroredOf(b)to find the nearest enclosingSTATUS_ERRORboundary at or aboveb(D-38, F-12).keeps(b, r)forSTATUS_ERRORboundaries soSTATUS_ERRORis only included whenerroredOf(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.packages/signals/docs/RULES-INDEX.mdrule citation counts forF-12andD-38.@solidjs/signalsregression tests inpackages/signals/tests/nested-errored-async-5261.test.ts(sync, async rethrow -> handled -> rethrow -> recovery, and pending sibling case) and an<Errored>integration test inpackages/solid/test/errored-nested-async-5261.spec.ts..changeset/nested-errored-async-rethrow.md("@solidjs/signals": patch).Validation
@solidjs/signals:vitest run— 574/577 files passed (nested-errored-async-5261.test.ts3/3 passed,errored-latest-loading-reask-4870.test.tspassed; the 3 failing files on Windows are environment-specific:rules-index.test.ts&treeshake.test.tspath separator checks anddist-artifacts.test.tsENAMETOOLONGon Windows CLI arg length).solid-js:vitest run— 57/60 files passed (errored-nested-async-5261.spec.ts1/1 passed; remaining 3 files fail locally due to missingpackages/universal/dist, Windows path separators inpublished-declarations.spec.ts, and Windows shebang transform indiagnostics-catalog.spec.ts).scripts/size(gate.mjs): all non-compiler scenarios pass (page: base34,239 B <= 34,240 B cap;page: live41,647 B <= 41,680 B cap;app: hydratingWARN under minified allowance); the 7 compiled scenarios were skipped locally due to missing@solidjs/compiler-wasm32-wasi.