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

AbortSignal.any does not work on all sequences #54674

Closed
KhafraDev opened this issue Aug 31, 2024 · 1 comment · Fixed by #54714
Closed

AbortSignal.any does not work on all sequences #54674

KhafraDev opened this issue Aug 31, 2024 · 1 comment · Fixed by #54714
Labels
web-standards Issues and PRs related to Web APIs

Comments

@KhafraDev
Copy link
Member

Version

v22.7.0

Platform

n/a

Subsystem

No response

What steps will reproduce the bug?

var it = { *[Symbol.iterator] () { return AbortSignal.timeout(100000) } }

AbortSignal.any(it)

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

It works

What do you see instead?

It throws an error

Additional information

Take a look at how undici handles sequences https://github.com/nodejs/undici/blob/3f1b57d28fc084b1ac712a7ca844b1b3fef77be8/lib/web/fetch/webidl.js#L272

Webidl: https://webidl.spec.whatwg.org/#es-sequence

Notice how the webidl for AbortSignal.any says sequence, not array:

[NewObject] static AbortSignal _any(sequence<AbortSignal> signals);

@avivkeller avivkeller added web-standards Issues and PRs related to Web APIs repro-exists labels Aug 31, 2024
@avivkeller
Copy link
Member

avivkeller commented Aug 31, 2024

> var it = { *[Symbol.iterator] () { return AbortSignal.timeout(100000) } }
undefined
> AbortSignal.any(it)
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "signals" argument must be an instance of Array. Received an instance of Object
    at validateAbortSignalArray (node:internal/validators:356:3)
    at AbortSignal.any (node:internal/abort_controller:228:5) {
  code: 'ERR_INVALID_ARG_TYPE'

aduh95 pushed a commit that referenced this issue Sep 12, 2024
Co-authored-by: Jake Yuesong Li <[email protected]>
PR-URL: #54714
Fixes: #54674
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
louwers pushed a commit to louwers/node that referenced this issue Nov 2, 2024
Co-authored-by: Jake Yuesong Li <[email protected]>
PR-URL: nodejs#54714
Fixes: nodejs#54674
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this issue Nov 21, 2024
Co-authored-by: Jake Yuesong Li <[email protected]>
PR-URL: nodejs#54714
Fixes: nodejs#54674
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-standards Issues and PRs related to Web APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants