@@ -2744,10 +2744,11 @@ function hasHeldTransitionUpdate(slot: TransitionActionSlot<unknown>, block: Blo
27442744}
27452745
27462746/**
2747- * True when a transition/urgent update targeted at this block was rolled back
2748- * and is still waiting to re-apply. Held entries re-apply inside the state hook
2749- * during render, so a memo/stable bail that skips the body would strand the
2750- * pending value while keeping the rolled-back DOM — the bail must decline.
2747+ * True when a transition/urgent update targeted at this block — or a descendant
2748+ * that owns the state cells — was rolled back and is still waiting to re-apply.
2749+ * Held entries re-apply inside the child's state hook during render, so a
2750+ * memo/stable ancestor bail that skips the body would strand the pending value
2751+ * while keeping the rolled-back DOM — the bail must decline.
27512752 */
27522753function blockHasHeldUpdate(block: Block): boolean {
27532754 const rootHeld = block.idState.renderOwner?.transition;
@@ -2761,7 +2762,7 @@ function blockHasHeldUpdate(block: Block): boolean {
27612762 if (entries === undefined) return false;
27622763 for (const entry of entries) {
27632764 if (
2764- entry.block === block &&
2765+ ( entry.block === block || blockIsAncestorOf(block, entry.block)) &&
27652766 !entry.superseded &&
27662767 Object.is(entry.slot.value, entry.baseValue)
27672768 )
@@ -2776,6 +2777,20 @@ function blockHasHeldUpdate(block: Block): boolean {
27762777 return false;
27772778}
27782779
2780+ /**
2781+ * A queued update dropped by an aborted transaction must be consumed by a
2782+ * later body re-run. The store write lives on this block, but a $$stable /
2783+ * memo ancestor with clean props would otherwise keep the committed subtree
2784+ * and never re-enter here — mark the whole ancestor chain so those bails
2785+ * decline. Cleared per block at the top of renderBlockInner.
2786+ */
2787+ function markSuppressedUpdate(block: Block): void {
2788+ for (let b: Block | null = block; b !== null; b = b.parentBlock) {
2789+ if (b.suppressedUpdate === true) break;
2790+ b.suppressedUpdate = true;
2791+ }
2792+ }
2793+
27792794function cancelHeldTransitionUpdate(slot: TransitionActionSlot<unknown>, block: Block): boolean {
27802795 if (!urgentTransitionCellUpdate(block)) return false;
27812796 const rootHeld = block.idState.renderOwner?.transition;
@@ -6786,9 +6801,10 @@ function drainQueue(): { err: any } | null {
67866801 // Once one suspends, later siblings must not publish a partial screen.
67876802 const rootTransaction = block.idState.renderOwner?.transaction;
67886803 if (rootTransaction?.aborted === true) {
6789- // The update is deferred to the resolve pass — flag it so a memo/
6790- // stable/implicit bail cannot skip the body that consumes it.
6791- block.suppressedUpdate = true;
6804+ // The update is deferred to the resolve pass — flag this block and its
6805+ // ancestors so a memo/stable/implicit bail cannot skip the body that
6806+ // would re-enter the child and consume the store write.
6807+ markSuppressedUpdate(block);
67926808 continue;
67936809 }
67946810 const retired = rootTransaction?.retired;
@@ -6798,7 +6814,10 @@ function drainQueue(): { err: any } | null {
67986814 // roots with an actual deferred deletion pay this ancestor walk.
67996815 let current: Block | null = block;
68006816 while (current !== null && !retired.has(current)) current = current.parentBlock;
6801- if (current !== null) continue;
6817+ if (current !== null) {
6818+ markSuppressedUpdate(block);
6819+ continue;
6820+ }
68026821 }
68036822 const crossRenderUpdate = block.crossRenderUpdate;
68046823 block.crossRenderUpdate = false;
@@ -6850,10 +6869,16 @@ function drainQueue(): { err: any } | null {
68506869 // retries the render; if it no longer suspends (an external store flipped
68516870 // before the suspending promise resolved), the boundary reveals now.
68526871 if (hiddenTry !== null) {
6872+ // The standalone body is dropped in favor of a boundary retry. Flag
6873+ // this block and its ancestors: the retry (or a later equal-props
6874+ // parent update) must not memo/stable/implicit-bail past the child
6875+ // that still holds the store write.
6876+ markSuppressedUpdate(block);
68536877 visibilityDriver!.reveal(hiddenTry, block.pendingMode ?? 'urgent');
68546878 continue;
68556879 }
68566880 if (hiddenActivity !== null && hiddenActivity.pendingThenable !== null) {
6881+ markSuppressedUpdate(block);
68576882 visibilityDriver!.retryActivity(hiddenActivity, true);
68586883 continue;
68596884 }
@@ -29766,12 +29791,7 @@ function componentSlotImpl(
2976629791 // ancestor chain so those bails decline. `LAZY_BODY_CHECK` marks eagerly —
2976729792 // the lazy wrapper's resolution-aware `__compare` is only installed once the
2976829793 // module resolves, after ancestors may already have committed.
29769- if ((body as any).__compare !== undefined || (body as any)[LAZY_BODY_CHECK] !== undefined) {
29770- for (let b: Block | null = parentBlock; b !== null; b = b.parentBlock) {
29771- if (b.$$compareInChain === true) break;
29772- b.$$compareInChain = true;
29773- }
29774- }
29794+ markCompareInChain(parentBlock, body);
2977529795 let state = parentScope.slots[slotKey] as CompSlot | undefined;
2977629796 let hydrationCursor: Node | null = null;
2977729797 if (state === undefined) {
@@ -34046,6 +34066,10 @@ export function childSlot(
3404634066 componentHasKey = value.key != null;
3404734067 }
3404834068 if (comp !== null) {
34069+ // Same veto-compare taint as componentSlot: a value-position memo/lazy
34070+ // child must still flag ancestors, or a later $$stable/memo bail keeps
34071+ // this subtree without invoking `__compare`.
34072+ markCompareInChain(parentBlock, comp);
3404934073 // A bare render-FUNCTION child (a `.tsrx` `{children}` body forwarded onto a `.ts`
3405034074 // component's host element via createElement) is re-created every render, so its
3405134075 // identity always differs — but it is the SAME slot child. Reconcile by SLOT like
@@ -34741,6 +34765,20 @@ function refreshContextConsumers(block: Block): void {
3474134765 }
3474234766}
3474334767
34768+ /**
34769+ * Flag ancestors when a callee's compare can veto on non-prop grounds (lazy
34770+ * re-resolution, custom comparators). Shared by componentSlot and childSlot so
34771+ * a value-position `{<Wrapped />}` still taints the chain. Sticky: a stale
34772+ * flag only costs a missed bail.
34773+ */
34774+ function markCompareInChain(parentBlock: Block | null, body: any): void {
34775+ if ((body as any).__compare === undefined && (body as any)[LAZY_BODY_CHECK] === undefined) return;
34776+ for (let b: Block | null = parentBlock; b !== null; b = b.parentBlock) {
34777+ if (b.$$compareInChain === true) break;
34778+ b.$$compareInChain = true;
34779+ }
34780+ }
34781+
3474434782/**
3474534783 * The hazards that veto every props-equality bail (memo, $$stable, implicit):
3474634784 * each names a reason the body must re-run regardless of prop equality. A new
0 commit comments