From df061b396644bb7c27ea76bb27ae09784ce6444b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Mon, 18 Sep 2023 11:25:21 -0400 Subject: [PATCH] [Fizz] Don't bail out of flushing if we still have pending root tasks (#27385) The idea for this check is that we shouldn't flush anything before we flush the shell. That may or may not hold true in future formats like RN. It is a problem for resuming because with resuming it's possible to have root tasks that are used for resuming but the shell was already flushed so we can have completed boundaries before the shell has fully resumed. What matters is whether the parent has already flushed or not. It's not technically necessary to bail early because there won't be anything in partialBoundaries or completedBoundaries because nothing gets added there unless the parent has already flushed. It's not exactly slow to have to check the length of three arrays so it's probably not a big deal. Flush partials in an early preamble needs further consideration regardless. --- packages/react-server/src/ReactFizzServer.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/react-server/src/ReactFizzServer.js b/packages/react-server/src/ReactFizzServer.js index cb75725c6b..ae5d61b5f8 100644 --- a/packages/react-server/src/ReactFizzServer.js +++ b/packages/react-server/src/ReactFizzServer.js @@ -3778,9 +3778,6 @@ function flushCompletedQueues( // We haven't flushed the root yet so we don't need to check any other branches further down return; } - } else if (request.pendingRootTasks > 0) { - // We have not yet flushed the root segment so we early return - return; } if (enableFloat) {