Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flight] Fix double-incremented pending chunks counter #31833

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

unstubbable
Copy link
Collaborator

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 vercel/next.js#73804.

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 vercel/next.js#73804.
Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 1:18pm

@react-sizebot
Copy link

Comparing: 2bd1c75...b8b2d61

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 510.71 kB 510.71 kB = 91.29 kB 91.29 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 516.86 kB 516.86 kB = 92.24 kB 92.24 kB
facebook-www/ReactDOM-prod.classic.js = 592.42 kB 592.42 kB = 104.37 kB 104.37 kB
facebook-www/ReactDOM-prod.modern.js = 582.68 kB 582.68 kB = 102.82 kB 102.82 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 5bfc376

Copy link
Collaborator

@gnoff gnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add check validation in dev if you ever go less than 0. This won’t protect us from this particular issue because the chunk counter would never hit zero but it could protect us from the opposite where too few were tracked. It also won’t help in prod but it’s basically free to highlight this one obviously buggy case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants