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
repro-exists Issues with reproductions. 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);

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

RedYetiDev 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 <jake.yuesong@gmail.com>
PR-URL: #54714
Fixes: #54674
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
louwers pushed a commit to louwers/node that referenced this issue Nov 2, 2024
Co-authored-by: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: nodejs#54714
Fixes: nodejs#54674
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repro-exists Issues with reproductions. web-standards Issues and PRs related to Web APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants