Skip to content

Commit eed2560

Browse files
authored
[Flight] Treat empty message as a close signal (facebook#33756)
We typically treat an empty message as closing the debug channel stream but for the Noop renderer we don't use an intermediate stream but just pass the message through. https://github.com/facebook/react/blob/bbc13fa17be8eebef3e6ee47f48c76c0c44e2f36/packages/react-server-dom-webpack/src/client/ReactFlightDOMClientBrowser.js#L59-L60 For that simple case we should just treat it as a close without an intermediate stream.
1 parent 463b808 commit eed2560

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5808,6 +5808,10 @@ export function resolveDebugMessage(request: Request, message: string): void {
58085808
"resolveDebugMessage/closeDebugChannel should not be called for a Request that wasn't kept alive. This is a bug in React.",
58095809
);
58105810
}
5811+
if (message === '') {
5812+
closeDebugChannel(request);
5813+
return;
5814+
}
58115815
// This function lets the client ask for more data lazily through the debug channel.
58125816
const command = message.charCodeAt(0);
58135817
const ids = message.slice(2).split(',').map(fromHex);

0 commit comments

Comments
 (0)