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

fix(fetch): allow custom implementation of AbortSignal #1608

Merged
merged 1 commit into from Aug 18, 2022

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Aug 18, 2022

The PR closes #1605.

A test case is added to ensure it is the DOMException being thrown, not TypeError.

cc @mcollina @KhafraDev

@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2022

Codecov Report

Merging #1608 (dd0bd7e) into main (5890e16) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1608      +/-   ##
==========================================
- Coverage   94.90%   94.88%   -0.03%     
==========================================
  Files          50       50              
  Lines        4753     4752       -1     
==========================================
- Hits         4511     4509       -2     
- Misses        242      243       +1     
Impacted Files Coverage Δ
lib/fetch/request.js 85.06% <ø> (+0.35%) ⬆️
lib/fetch/file.js 91.66% <0.00%> (-1.20%) ⬇️
lib/fetch/webidl.js 97.74% <0.00%> (-0.57%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ronag ronag merged commit d83c1e2 into nodejs:main Aug 18, 2022
@KhafraDev
Copy link
Member

This wasn't the correct solution; it makes us fall out of line with the spec. Instead, when parsing an AbortSignal, a strict option should have been passed instead. See

if (opts.strict !== false && !(V instanceof i)) {

Of course the webidl interface converter could also be improved such that when passing a strict: false option, it would check the object's Symbol.toStringTag/constructor name.

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.

Can't bring custom abort-controller implementation to undici.fetch
4 participants