[Flight] Treat empty message as a close signal (#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.
Sebastian Markbåge committed
Jul 10, 2025 at 16:16 UTC
eed25607629f5e67f13f53e91edec12b3388559f
1 file changed
+4
packages/react-server/src/ReactFlightServer.js
+4
@@ -5808,6 +5808,10 @@ export function resolveDebugMessage(request: Request, message: string): void {
5808
"resolveDebugMessage/closeDebugChannel should not be called for a Request that wasn't kept alive. This is a bug in React.",
5809
);
5810
}
5811
+ if (message === '') {
5812
+ closeDebugChannel(request);
5813
+ return;
5814
+ }
5815
// This function lets the client ask for more data lazily through the debug channel.
5816
const command = message.charCodeAt(0);
5817
const ids = message.slice(2).split(',').map(fromHex);