Skip to content

Commit 1b171ea

Browse files
committed
fix(runtime): prevent pending render from poisoning text hole token
When bindSignalChild's primitive fast path skips writing because the current block is pending, the function was still returning the new value as the hole token. This caused the subsequent committed render with the same value to identity-skip (previous === value) and never call setText, leaving stale DOM text in place. Hoist the pending condition into a pendingSkip variable and gate the token return on it, so a pending render preserves the previous token and the committed render always writes.
1 parent 6812f00 commit 1b171ea

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35652,11 +35652,8 @@ export function bindSignalChild(
3565235652
value !== null &&
3565335653
type !== 'object' &&
3565435654
type !== 'function';
35655-
if (
35656-
primitiveToken &&
35657-
prior === null &&
35658-
!(CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate)
35659-
) {
35655+
const pendingSkip = !!(CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate);
35656+
if (primitiveToken && prior === null && !pendingSkip) {
3566035657
const state = parentScope.slots[slotKey] as ChildSlot | undefined;
3566135658
if (
3566235659
state !== undefined &&
@@ -35686,7 +35683,7 @@ export function bindSignalChild(
3568635683
if (WIP_CAPTURE === null) finish(false);
3568735684
else (WIP_CAPTURE.renderCleanups ??= []).push(finish);
3568835685
}
35689-
return primitiveToken ? value : text;
35686+
return primitiveToken && !pendingSkip ? value : text;
3569035687
}
3569135688
if (prior !== null && !prior.disposed && prior.handle === value) {
3569235689
const next = readSignalBinding(value);

0 commit comments

Comments
 (0)