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

(cherrypick) [Fizz][Float] Do not write after closing the stream (#27541) #31881

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Dec 20, 2024

Float methods can hang on to a reference to a Request after the request is closed due to AsyncLocalStorage. If a Float method is called at this point we do not want to attempt to flush anything. This change updates the closing logic to also call stopFlowing which will ensure that any checks against the destination properly reflect that we cannot do any writes. In addition it updates the enqueueFlush logic to existence check the destination inside the work function since it can change across the work scheduling gap if it is async.

Float methods can hang on to a reference to a Request after the request
is closed due to AsyncLocalStorage. If a Float method is called at this
point we do not want to attempt to flush anything. This change updates
the closing logic to also call `stopFlowing` which will ensure that any
checks against the destination properly reflect that we cannot do any
writes. In addition it updates the enqueueFlush logic to existence check
the destination inside the work function since it can change across the
work scheduling gap if it is async.

fixes: facebook#27540
Copy link

vercel bot commented Dec 20, 2024

@gnoff is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Dec 20, 2024
@gnoff gnoff merged commit 1dba980 into facebook:sync-nextjs-13 Dec 20, 2024
2 of 4 checks passed
ztanner added a commit to vercel/next.js that referenced this pull request Dec 21, 2024
Update React from d900fadbf to 1dba980e1f.

### React upstream changes

- facebook/react#31881
- facebook/react#31872

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
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