Conversation
🦋 Changeset detectedLatest commit: fac263d The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
Co-authored-by: Cursor <cursoragent@cursor.com>
The broader condition also skips the run an optimistic lane queues for a
born-held effect; that run applied an uncommitted value too. Also align
the inline comment with effect.ts ('the commit replays the effect').
Co-authored-by: Claude via Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ryansolid
added a commit
that referenced
this pull request
Oct 6, 2026
…as never committed (#3820) A dated SPEC amendment (2026-10-06) naming the rule the create-time fixes each implement by checking commit status: the loading-source rule, #3814 (#3802), and the pending #3800 and in-flush #3540 fixes. The same-tick and in-flush shapes are recorded as not yet one-way and pinned it.fails in tests/direction-rule-probe.test.ts; the boundary shape passes today. Cross-references in INTERNALS-ASYNC-STATE.md §0 and the carve plan. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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 #3802. If a
<Show>child mounts while an action holds a write, creates a memo over the held signal, and then a second, unheld signal changes before the action lands, the div's attribute render effect calls its compiled callback withundefined. The callback throwsCannot destructure property 'e' of 'undefined'and reactivity halts.Root cause: the effect's first pass reads the held world, so it is born held (A29). Its value is staged, it has no committed value, and its first run belongs to the commit that lands the action. When
titlechanges,recomputeruns the effect again and re-stages the new value, which is correct. It also set_modifiedand queuedrunEffect, which then ran the callback with the empty committed_value.The change adds one condition to that enqueue in
recompute(core.ts): an effect that still carries a staged value (_pendingValue !== NOT_PENDING) is not queued, becausecommitPendingNodequeues its run when the staged value commits. That run gets the latest staged value. The lane branch re-stages a born-held effect the same way, so the condition is not limited to the non-lane path. For an initialized held effect that re-stages inside its transaction's flush, the run skipped here would have re-applied the old committed value, so dropping it changes nothing visible.How did you test this change?
packages/signals/tests/held-effect-restage-run-3802.test.tscovers the shape from the issue with a plain render effect. It asserts that the effect does not run while the action is pending, and runs once with[true, "Updated"]after it lands.packages/web/test/held-action-memo-mount-3802.spec.tsxports the playground through compiled JSX.nextwith the reported TypeError and pass with the change.npx vitest runinpackages/signals: 4942 passed, 0 failed.packages/solid: 819 passed.npx vitest runinpackages/web: 1107 passed, 33 failed. The same 33 fail onnextwithout this change on my machine, which runs an older prebuilt compiler binary.Open
The change is +10 B minified on every scenario that retains signals core. Brotli moves between -36 B and +76 B depending on the scenario, and two non-floor caps are exceeded, so the size check fails until a maintainer decides on them.
check-floor-capspasses. I did not raise the caps because the cost has not been accepted.nextI measured four placements of the same condition in the
if. Every one exceeds some cap, and the other three each exceed a frozen floor cap (core floor, hydrating, or live server components).🤖 Generated with Claude Code
Maintainer follow-ups
Pushed by the maintainer side: merges of current
next, a second test inheld-effect-restage-run-3802.test.ts(the optimistic-lane variant: the one case where this PR's condition is needed over a born-held-only condition — it throws onnextand with the narrower condition), and a comment wording tweak. No cap changes: under the size gate from #3821 the +10 B minified is reported as noise.