Skip to content

[Fizz] Fix truncated prerender output under backpressure - #37901

Merged
unstubbable merged 1 commit into
react:mainfrom
unstubbable:hl/fix-fizz-prerender-truncation-on-back-pressure
Oct 19, 2026
Merged

unstubbable merged 1 commit into
react:mainfrom
unstubbable:hl/fix-fizz-prerender-truncation-on-back-pressure

Conversation

@unstubbable

Copy link
Copy Markdown
Collaborator

An aborted prerender can finish all tasks while partial output remains queued. If a Node stream applies backpressure, Fizz can close it before it flushes the remaining boundaries. This bug predates #37876 and also affects initial prerenders.

Fizz now waits for partialBoundaries to empty before it closes the destination. The regression test forces backpressure with highWaterMark: 1 and verifies that push() returns false. Without the fix, the stream emits the first boundary's partial content and closes before it emits the second's.

An aborted prerender can finish all tasks while partial output remains
queued. If a Node stream applies backpressure, Fizz can close it before
it flushes the remaining boundaries. This bug predates react#37876 and also
affects initial prerenders.

Fizz now waits for `partialBoundaries` to empty before it closes the
destination. The regression test forces backpressure with
`highWaterMark: 1` and verifies that `push()` returns `false`. Without
the fix, the stream emits the first boundary's partial content and
closes before it emits the second's.
@meta-cla meta-cla Bot added the CLA Signed label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Comparing: e92156b...fb534ae

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 = 7.35 kB 7.35 kB +0.05% 1.96 kB 1.96 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 626.10 kB 626.10 kB = 110.63 kB 110.63 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.36 kB 7.36 kB = 1.96 kB 1.96 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 697.31 kB 697.31 kB = 122.07 kB 122.07 kB
facebook-www/ReactDOM-prod.classic.js = 715.35 kB 715.35 kB = 125.14 kB 125.14 kB
facebook-www/ReactDOM-prod.modern.js = 705.66 kB 705.66 kB = 123.57 kB 123.57 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by sizebot against fb534ae

@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Oct 19, 2026
@unstubbable
unstubbable marked this pull request as ready for review October 19, 2026 17:29
@unstubbable
unstubbable requested a review from gnoff October 19, 2026 17:29
@unstubbable
unstubbable merged commit a679270 into react:main Oct 19, 2026
248 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 19, 2026
eps1lon pushed a commit to vercel/next.js that referenced this pull request Oct 20, 2026
[diff
react/react@ba39b32a...a6792708](react/react@ba39b32...a679270)

<details>
<summary>React upstream changes</summary>

- react/react#37901
- react/react#37876

</details>

---------

Co-authored-by: next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants