Skip to content

Commit ced0059

Browse files
committed
fix(suspense): skip nested hidden try blocks when retaining signal retry scope
retainSignalRetryScope and detachSignalRetryScope walked nested Suspense boundaries' hidden primaries via forEachSubtreeChild with includeHiddenTry=true (the default). This stored inner owners on the outer boundary's cache. When the replacement rendered, each inner boundary's own cache was empty, so it started new loads while the old ones leaked on the outer cache until reveal. Pass includeHiddenTry=false so each nested boundary manages its own signal retry owners through its own lifecycle.
1 parent 4352a7a commit ced0059

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ function retainSignalRetryScope(
698698
}
699699
}
700700
if (subtree)
701-
forEachSubtreeChild(scope, (child) => retainSignalRetryScope(child, root, holder, true));
701+
forEachSubtreeChild(scope, (child) => retainSignalRetryScope(child, root, holder, true), false);
702702
else if (scope.children !== null)
703703
for (const child of scope.children) retainSignalRetryScope(child.scope, root, holder);
704704
}
@@ -709,7 +709,7 @@ function retainSignalRetryScope(
709709
function detachSignalRetryScope(scope: Scope, cache: SignalRetryOwners): void {
710710
const owner = SCOPE_SIGNAL_OWNERS.get(scope);
711711
if (owner && cache.owners.has(owner)) SCOPE_SIGNAL_OWNERS.set(scope, false);
712-
forEachSubtreeChild(scope, (child) => detachSignalRetryScope(child, cache));
712+
forEachSubtreeChild(scope, (child) => detachSignalRetryScope(child, cache), false);
713713
}
714714

715715
function clearSignalRetryOwners(holder: { retrySignalOwners?: SignalRetryOwners }): void {

0 commit comments

Comments
 (0)