Skip to content

Commit

Permalink
Don't bail out of flushing if we still have pending root tasks
Browse files Browse the repository at this point in the history
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 from resuming but the shell was already flushed
so we can have completed boundaries before the shell has fully resumed.

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.
  • Loading branch information
sebmarkbage committed Sep 17, 2023
1 parent a5fc797 commit 1fd724e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1fd724e

Please sign in to comment.