mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[Flight] Fix double-incremented pending chunks counter (#31833)
Before calling `emitTimingChunk` inside of `forwardDebugInfo`, we must not increment `request.pendingChunks`, as this is already done inside of the `emitTimingChunk` function. I don't have a unit test for this, but manually verified that this fixes the hanging responses in https://github.com/vercel/next.js/pull/73804.
This commit is contained in:
+1
-1
@@ -3810,11 +3810,11 @@ function forwardDebugInfo(
|
||||
debugInfo: ReactDebugInfo,
|
||||
) {
|
||||
for (let i = 0; i < debugInfo.length; i++) {
|
||||
request.pendingChunks++;
|
||||
if (typeof debugInfo[i].time === 'number') {
|
||||
// When forwarding time we need to ensure to convert it to the time space of the payload.
|
||||
emitTimingChunk(request, id, debugInfo[i].time);
|
||||
} else {
|
||||
request.pendingChunks++;
|
||||
if (typeof debugInfo[i].name === 'string') {
|
||||
// We outline this model eagerly so that we can refer to by reference as an owner.
|
||||
// If we had a smarter way to dedupe we might not have to do this if there ends up
|
||||
|
||||
Reference in New Issue
Block a user