-
-
Notifications
You must be signed in to change notification settings - Fork 666
fix: fix wrong stream canceled up after cloning (v6) #4414
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes a bug where the wrong stream was being registered with the finalization registry when cloning Response objects. This was causing premature cancellation of the original response's stream when the cloned response was garbage collected.
- Changed the stream registration from
out1
toout2
in the clone body logic - Added a test to verify that garbage collection of a clone doesn't affect the original response
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
lib/web/fetch/body.js | Fixed stream registry to register the correct stream (out2 instead of out1) for the cloned instance |
test/fetch/response.js | Added test to verify that garbage collection of cloned response doesn't break the original response |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
Merging as the failed CI is unrelated. |
This relates to...
Rationale
The request/stream registered with the finalization registry is mixed up between the clone and the original request.
Changes
This PR just changes which of the two tee'd streams is associated
edit: updated with changes from @tsctx how we're fixing the stream registration is moved to a better location #4419
Features
N/A
Bug Fixes
See
changes
aboveBreaking Changes and Deprecations
N/A
Status