Skip to content

Commit d8866f0

Browse files
committed
fix(signals): back to recompute's arm for the #4378 re-derive
Every frame node up the chain (the boundaries' trees and outputs) drops its staging there, most of them re-run from the heap rather than through redraw, so the generator's E8 case still failed with the redraw version. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
1 parent 0f09661 commit d8866f0

4 files changed

Lines changed: 11 additions & 29 deletions

File tree

‎.changeset/superseded-held-frame-rederives-readers.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"@solidjs/signals": patch
33
---
44

5-
A reader created in the flush that clears an upstream error, under `<Errored>` and `<Loading>`, now shows the async memo's error once it rejects, instead of an empty hole. The rejection re-ran the error boundary outside the hold that had staged its content, and the boundary went back to the fallback it had already committed. Because that was no change, the boundary's reader did not re-run, and the hold's landing applied its stale run of the content. When a boundary's re-run replaces a staging of its output, the readers of that output now re-derive (#4378).
5+
A reader created in the flush that clears an upstream error, under `<Errored>` and `<Loading>`, now shows the async memo's error once it rejects, instead of an empty hole. The rejection re-ran the error boundary outside the hold that had staged its content, and the boundary went back to the fallback it had already committed. Because that was no change, the boundary's reader did not re-run, and the hold's landing applied its stale run of the content. A held frame node that re-runs outside its hold now re-derives the readers of the staging it replaces (#4378).

‎packages/signals/src/boundaries.ts‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ import {
7272
haltReactivity,
7373
haltReactivityAt,
7474
heldUnder,
75-
insertSubs,
7675
joinFuture,
7776
passLane,
7877
passTx,
@@ -217,16 +216,8 @@ function flip(b: Boundary): void {
217216
}
218217

219218
export function redraw(b: Boundary): void {
220-
const o = b._output;
221-
if (o !== null && !(o._flags & (REACTIVE_DISPOSED | REACTIVE_ZOMBIE))) {
222-
// A held output's pass replaces what it staged. Outside the hold, the
223-
// pass publishes mainline (`recompute`, #3404), and it may be the
224-
// committed value back (a held swap to content, then the fallback
225-
// again): no change, so nothing tells the readers that ran on the
226-
// staging, and the landing applies their held runs of the superseded
227-
// frame. They re-derive with the output (#4378).
228-
if (o._config & CONFIG_HELD) insertSubs(o);
229-
enqueueSub(o);
219+
if (b._output !== null && !(b._output._flags & (REACTIVE_DISPOSED | REACTIVE_ZOMBIE))) {
220+
enqueueSub(b._output);
230221
schedule();
231222
}
232223
}

‎packages/signals/src/core/core.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,11 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
424424
// children die below (`disposeChildren`). The landing re-derives a
425425
// fresh held frame for the reveal (`_reruns`).
426426
// Not held any more, whichever frame reader it is: its readers read
427-
// the value this pass publishes.
427+
// the value this pass publishes — those that read the staging it
428+
// supersedes re-derive, even when it publishes the committed value
429+
// back (no change to notify them by): their held runs carry the
430+
// superseded frame, and the landing would apply them (#4378).
431+
if (el._pendingValue !== NOT_PENDING) insertSubs(el);
428432
el._pendingValue = NOT_PENDING;
429433
el._config &= ~CONFIG_HELD;
430434
}

0 commit comments

Comments
 (0)