Skip to content

Commit c1bc974

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 c1bc974

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/react-server/src/ReactFizzServer.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3931,9 +3931,7 @@ function flushCompletedQueues(
39313931
destination,
39323932
request.resumableState,
39333933
request.renderState,
3934-
request.allPendingTasks === 0 &&
3935-
(request.trackedPostpones === null ||
3936-
request.trackedPostpones.workingMap.size === 0), // TODO
3934+
request.allPendingTasks === 0 && request.trackedPostpones === null,
39373935
);
39383936
}
39393937

@@ -4028,13 +4026,7 @@ function flushCompletedQueues(
40284026
if (enableFloat) {
40294027
// We write the trailing tags but only if don't have any data to resume.
40304028
// If we need to resume we'll write the postamble in the resume instead.
4031-
if (
4032-
!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
4037-
) {
4029+
if (!enablePostpone || request.trackedPostpones === null) {
40384030
writePostamble(destination, request.resumableState);
40394031
}
40404032
}
@@ -4186,6 +4178,8 @@ export function getPostponedState(request: Request): null | PostponedState {
41864178
(trackedPostpones.rootNodes.length === 0 &&
41874179
trackedPostpones.rootSlots === null)
41884180
) {
4181+
// Reset. Let the flushing behave as if we completed the whole document.
4182+
request.trackedPostpones = null;
41894183
return null;
41904184
}
41914185
return {

0 commit comments

Comments
 (0)