Skip to content

Commit 2fd8329

Browse files
committed
Reset trackedPostpones if nothing postponed
We can't rely on workingMap.size because we're now adding the fallback nodes eagerly to the map.
1 parent dfafc84 commit 2fd8329

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/react-server/src/ReactFizzServer.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3932,8 +3932,7 @@ function flushCompletedQueues(
39323932
request.resumableState,
39333933
request.renderState,
39343934
request.allPendingTasks === 0 &&
3935-
(request.trackedPostpones === null ||
3936-
request.trackedPostpones.workingMap.size === 0), // TODO
3935+
request.trackedPostpones === null,
39373936
);
39383937
}
39393938

@@ -4030,10 +4029,7 @@ function flushCompletedQueues(
40304029
// If we need to resume we'll write the postamble in the resume instead.
40314030
if (
40324031
!enablePostpone ||
4033-
request.trackedPostpones === null ||
4034-
// We check the working map instead of the root because the root could've
4035-
// been mutated at this point if it was passed straight through to resume().
4036-
request.trackedPostpones.workingMap.size === 0 // TODO
4032+
request.trackedPostpones === null
40374033
) {
40384034
writePostamble(destination, request.resumableState);
40394035
}
@@ -4186,6 +4182,8 @@ export function getPostponedState(request: Request): null | PostponedState {
41864182
(trackedPostpones.rootNodes.length === 0 &&
41874183
trackedPostpones.rootSlots === null)
41884184
) {
4185+
// Reset. Let the flushing behave as if we completed the whole document.
4186+
request.trackedPostpones = null;
41894187
return null;
41904188
}
41914189
return {

0 commit comments

Comments
 (0)