fix(signals): preserve parked effects when transitions merge - #3310
fix(signals): preserve parked effects when transitions merge#3310DerpyCrabs wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: b25f2d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
db4644b to
b25f2d9
Compare
When a pending action's transaction merges into another (initTransition called with a transaction while a different one is active), the outgoing transaction's parked effects — its _queueStash, filled by every flush that found it incomplete — were dropped on the floor. Signal values still committed through the surviving transaction, but the render effects that would have painted them never ran: stale DOM after a correct commit. Restore the outgoing stash onto the live queue at the merge site. This flush then parks those effects again under the surviving transaction or runs them when it completes — the lifecycle every other parked effect has. The outgoing transaction is dead after the merge (_done chased, removed from `transitions`, never stashed into or completed), so its stash is not reset; nothing reads it again. Regression test from the PR: two actions, the second holding an optimistic write the first later merges into; on `next` the render effect stays at [0] after both settle, with the fix it reaches [0, 1]. No changeset: rc.7 is already versioned on `next` but unpublished (the Release run was blocked by the Compiler-binaries harness bug fixed in the previous commit), so the entry is folded directly into the rc.7 section of packages/signals/CHANGELOG.md rather than triggering an rc.8 bump. Closes #3310 Co-authored-by: DerpyCrabs <derpycrabs@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Summary
Fixes lost render updates when a pending action merges into another transaction. Signal values commit correctly, but the DOM can remain stale because
mergeTransitionStatedoes not transfer the outgoing transaction’s parked effect queues.The fix restores those effects into the scheduler and clears the outgoing stash. Includes a minimal regression test and a patch changeset for
@solidjs/signals.How did you test this change?
Confirmed the regression test fails on current
next(94fe5b46) without this fix and passes with it. Also verified a standalone reproduction using only@solidjs/signalsand the original application’s grid-switching and clipboard-replacement failures.Completed validation using Node 24, matching
.nvmrc:pnpm i— passed.pnpm --filter @solidjs/compiler run build— passed; prerequisite used by upstream CI.pnpm build— all 25 tasks passed.pnpm test— all 33 tasks passed, including workspace type tests: 4,399 tests passed, 3 skipped.