Skip to content

fix(signals): propagate async setter errors - #3262

Merged
ryansolid merged 1 commit into
solidjs:nextfrom
GabbeV:fix/async-setter-error-propagation
Sep 4, 2026
Merged

fix(signals): propagate async setter errors#3262
ryansolid merged 1 commit into
solidjs:nextfrom
GabbeV:fix/async-setter-error-propagation

Conversation

@GabbeV

@GabbeV GabbeV commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Errors thrown by a custom setter while applying an asynchronous computed result currently escape from the promise fulfillment callback. For store projections this can happen when reconciliation invokes a user-provided key selector: the application gets an unhandled rejection and the projection does not enter its error state.

This routes those errors through the existing async handleError path, matching rejected computations and the existing handling for errors from async comparators.

The regression test uses an ordinary seeded projection whose key selector throws during asynchronous reconciliation, so this fix is independent of the seedless-store proposal.

Testing

  • pnpm exec vitest run tests/store/createProjection.async.test.ts --reporter=dot (32 tests)
  • pnpm types in packages/signals

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ec587ae

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

This PR includes changesets to release 11 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

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

@codspeed-hq

codspeed-hq Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 136 untouched benchmarks


Comparing GabbeV:fix/async-setter-error-propagation (ec587ae) with next (e346e61)

Open in CodSpeed

@ryansolid
ryansolid force-pushed the fix/async-setter-error-propagation branch from f631c04 to ec587ae Compare September 4, 2026 10:35
@ryansolid
ryansolid merged commit 0653673 into solidjs:next Sep 4, 2026
4 of 6 checks passed
ryansolid added a commit that referenced this pull request Sep 4, 2026
…atch

#3264/#3265/#3266 (+ dev-only #3263) land ~35 B on always-retained store
paths, and #3262's handleAsync try/catch adds ~5 B to the core scenarios.
A golf pass was attempted and measured strictly worse in every direction
(helper extraction +29 B, full inline +70 B, has-trap arm merge -1/+7 B) —
the graph is at its brotli optimum post-#3270. Ratchet per convention with
audit notes: createStore 14.16 -> 14.20 KB, isPending/latest 10.04 -> 10.05,
store-family app 26.25 -> 26.27. No package source changes, no changeset.

Co-authored-by: Cursor <cursoragent@cursor.com>
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 participants