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

Bugfix - when using AbortController, errors on resulting stream must be caught #539

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

uriva
Copy link

@uriva uriva commented Nov 9, 2024

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)

Bugfix, according to nodejs/undici#3353 (comment)

Which issue (if any) does this pull request address?

webtorrent/webtorrent#2874

Is there anything you'd like reviewers to focus on?

@uriva
Copy link
Author

uriva commented Nov 11, 2024

What I saw is that when I add this line and remove the fetch polyfill the problem disappears.

According to what you said the polyfill resolves to native fetch on newer node versions, so this means its removal is not essential.

However when I kept the fetch polyfill, some tests failed, I assume due to some older versions not returning a response with body which is a stream, so I added a check to validate the output for different versions.

According to my logic this should solve the bug and not regress anything, but please let me know if I missed something.

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

Successfully merging this pull request may close these issues.

1 participant