fix(signals): suspend stale readers on an uninitialized memo held by another transition - #3043
Open
brenelz wants to merge 1 commit into
Open
Conversation
…another transition A render effect that switches onto an async memo still in flight under a different transaction took the "show the committed value, don't entangle" path in read(). An uninitialized memo has no committed value, so the reader was served `undefined` as if settled, direct-committed outside both transactions, and never re-ran when either landed — stuck on its old value (a globally cached async memo shared by two inputs updated 300ms apart). Throw NotReady like the firewall-backed branch already did: the reader registers as a reporter of the source and the transactions merge and reveal together. Regression from the needsPendingCommit gate in 7d4d0c3 (beta.11), which removed the accidental pending-node stamp that had been entangling the reader. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 6a67056 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 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
read(). An uninitialized memo has no committed value, so the reader gotundefinedas if settled, direct-committed outside both transactions, and never re-ran when either landed — stuck on its old value forever.cache[k] ??= createMemo(async …)shared by several inserts,setAthensetB300ms later where B's new key is the memo A already put in flight. Worked on beta.10, broke in beta.11.owner !== elfrom theSTATUS_UNINITIALIZEDthrow branch so plain memos suspend the way firewall-backed store reads already did. The reader registers as a reporter and the two transactions merge and reveal together.needsPendingCommitgate removed an accidental pending-node push thatinitTransitionhad been stamping with_transition, which was what entangled the reader before.Test plan
tests/stale-read-uninitialized-cross-transition.test.ts— fails without the fix; includes a control showing an initialized held memo still shows its committed value without entangling@solidjs/signalssuite: 1336 passsolid-jssuite: 561 pass<div>inserts under<Loading>) and variants endfoo1 foo1 bar1Note: 5 solid-web tests (
frames-behavior-claims,server-functions-csrf/extensions,welcome-status-loaded/streamed) fail identically with and without this change on the published dom-expressions0.50.0-next.43— the committedlink:../dom-expressions-dr2/...overrides inpnpm-workspace.yaml/lockfile from 515ff56 only resolve on a machine with that checkout.🤖 Generated with Claude Code