Skip to content

Commit

Permalink
Re-add reentrancy avoidance
Browse files Browse the repository at this point in the history
I removed the equivalency of this in facebook#22446. However, I didn't fully
understand the intended semantics of the spec but I understand this better.

I believe this fixes facebook#22772.

This includes the test from facebook#22889 but should ideally have one for Fizz.
  • Loading branch information
sebmarkbage committed Feb 23, 2022
1 parent 5619560 commit dbd4eac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,10 @@ export function startFlowing(request: Request, destination: Destination): void {
if (request.status === CLOSED) {
return;
}
if (request.destination !== null) {
// We're already flowing.
return;
}
request.destination = destination;
try {
flushCompletedQueues(request, destination);
Expand Down
4 changes: 4 additions & 0 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,10 @@ export function startFlowing(request: Request, destination: Destination): void {
if (request.status === CLOSED) {
return;
}
if (request.destination !== null) {
// We're already flowing.
return;
}
request.destination = destination;
try {
flushCompletedChunks(request, destination);
Expand Down

0 comments on commit dbd4eac

Please sign in to comment.