Skip to content

Commit dbd4eac

Browse files
committed
Re-add reentrancy avoidance
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.
1 parent 5619560 commit dbd4eac

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/react-server/src/ReactFizzServer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,10 @@ export function startFlowing(request: Request, destination: Destination): void {
19501950
if (request.status === CLOSED) {
19511951
return;
19521952
}
1953+
if (request.destination !== null) {
1954+
// We're already flowing.
1955+
return;
1956+
}
19531957
request.destination = destination;
19541958
try {
19551959
flushCompletedQueues(request, destination);

packages/react-server/src/ReactFlightServer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,10 @@ export function startFlowing(request: Request, destination: Destination): void {
790790
if (request.status === CLOSED) {
791791
return;
792792
}
793+
if (request.destination !== null) {
794+
// We're already flowing.
795+
return;
796+
}
793797
request.destination = destination;
794798
try {
795799
flushCompletedChunks(request, destination);

0 commit comments

Comments
 (0)