Skip to content

Commit b61bf62

Browse files
committed
Revert "perf(signals): re-run a claim's verdict reader at release without comparing (#4570)"
The unconditional re-run makes a verdict reader in a claim emit twice at release (create-deferred-hydration.spec.ts, D-40). Keep the compare. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0117BoWNSSgtemsSYsaX2hXE
1 parent a6d4129 commit b61bf62

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ function verdictValue(el: Signal<any> | Computed<any>, c: Computed<any> | null):
458458
// `a()` in a claim shows the server's frame whole (F-1), not a client
459459
// write's flight the markup never had — which would put a boundary over
460460
// it in a fallback the server never rendered, claimed against nothing
461-
// (#4570). `isPending` answers for that frame: nothing in flight.
461+
// (#4570). `isPending` answers for that frame: nothing in flight. The
462+
// reader replays at the scope's release.
462463
const sv =
463464
snapshotCaptureActive && c && c._config & CONFIG_IN_SNAPSHOT_SCOPE
464465
? el._x?._snapshotValue
@@ -467,11 +468,11 @@ function verdictValue(el: Signal<any> | Computed<any>, c: Computed<any> | null):
467468
// Shadow (S0): the window's decision point — the rows Vl*/Vp*.
468469
if (__TEST__) shadowExpect(c, el, tracking, latestActive ? 2 : 1, spectating, served);
469470
if (served) {
470-
// Marked stale unconditionally (`read` compares first): a verdict reader
471-
// in a claim re-runs once at the scope's release — hydration only.
472-
c!._flags |= REACTIVE_SNAPSHOT_STALE;
471+
const snapshot = sv === NO_SNAPSHOT ? undefined : sv;
472+
if ((el._pendingValue !== NOT_PENDING ? el._pendingValue : el._value) !== snapshot)
473+
c!._flags |= REACTIVE_SNAPSHOT_STALE;
473474
if (__TEST__) shadowActual(SLOT_SNAPSHOT);
474-
return sv === NO_SNAPSHOT ? undefined : sv;
475+
return snapshot;
475476
}
476477
// A live `affects()` mark on the node or a dependency (affects.ts): not
477478
// final by declaration — the value itself is read as below. The verdict is

0 commit comments

Comments
 (0)