Skip to content

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

Merged
ronag merged 1 commit intonodejs:mainfrom
SukkaW:fix-1605
Aug 18, 2022
Merged

fix(fetch): allow custom implementation of AbortSignal#1608
ronag merged 1 commit intonodejs:mainfrom
SukkaW:fix-1605

Conversation

@SukkaW
Copy link
Copy Markdown
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
Copy Markdown

codecov-commenter commented Aug 18, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.88%. Comparing base (5890e16) to head (dd0bd7e).
⚠️ Report is 1886 commits behind head on main.

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ronag ronag merged commit d83c1e2 into nodejs:main Aug 18, 2022
@KhafraDev
Copy link
Copy Markdown
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