-
-
Notifications
You must be signed in to change notification settings - Fork 32k
lib: validate AbortSignal.timeout delay per its WebIDL definition #58594
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
base: main
Are you sure you want to change the base?
Conversation
351dacb
to
83f5055
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58594 +/- ##
==========================================
+ Coverage 90.15% 90.16% +0.01%
==========================================
Files 636 636
Lines 187891 187899 +8
Branches 36879 36888 +9
==========================================
+ Hits 169386 169413 +27
+ Misses 11272 11243 -29
- Partials 7233 7243 +10
🚀 New features to boost your workflow:
|
Commit Queue failed- Loading data for nodejs/node/pull/58594 ✔ Done loading data for nodejs/node/pull/58594 ----------------------------------- PR info ------------------------------------ Title lib: bypass `delay` in AbortSignal.timeout (#58594) Author Alex Yang <[email protected]> (@himself65) Branch himself65:himself65/2025/06/06/timer -> nodejs:main Labels author ready, needs-ci Commits 1 - lib: bypass `delay` in AbortSignal.timeout Committers 1 - Alex Yang <[email protected]> PR-URL: https://github.com/nodejs/node/pull/58594 Fixes: https://github.com/nodejs/node/issues/58592 Reviewed-By: Jake Yuesong Li <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/58594 Fixes: https://github.com/nodejs/node/issues/58592 Reviewed-By: Jake Yuesong Li <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 06 Jun 2025 02:54:17 GMT ✔ Approvals: 1 ✔ - Jake Yuesong Li (@jakecastelli): https://github.com/nodejs/node/pull/58594#pullrequestreview-2907023450 ✘ This PR needs to wait 118 more hours to land (or 0 hours if there is one more approval) ✘ Last GitHub CI failed ℹ Last Full PR CI on 2025-06-08T02:12:11Z: https://ci.nodejs.org/job/node-test-pull-request/67324/ - Querying data for job/node-test-pull-request/67324/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/15514793432 |
PRs need two reviews to be landable after 48 hours. With one review a 7 day wait period is observed. A passing CI is also required. |
cc @nodejs/web-standards |
delay
in AbortSignal.timeout0ca0bbb
to
64e4c90
Compare
I'll take care of the WPT update separately. |
thank u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, just relaxing this JS validation won't entirely fix the situation.
The rest of the codepath still only supports uint32 and anything bigger has its duration set to 1 instead. I'll look into it.
./node -e 'AbortSignal.timeout(Number.MAX_SAFE_INTEGER)'
(node:51580) TimeoutOverflowWarning: 9007199254740991 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
Edit: I don't know what it would take for lib/internal/timers.js to support the range (0, Number.MAX_SAFE_INTEGER) in class Timeout
.
cc @nodejs/timers ☝️ |
I think maybe we should merge this PR first and change setTimeout behavior later. seems to be separate PR? Just found webidl says setTimeout only supports a signed long int |
Right now large values are rejected, after this PR they will be accepted but the timeout will be set to 1 instead, so no, I don't think we should accept the PR as-is. At best you could change this to the original uint32 but using WebIDL conversion, i.e. |
64e4c90
to
70d006a
Compare
commit updated. according to the old code. I think we from only supports uint32 to uint32 + float + loose convert value |
Co-authored-by: Filip Skokan <[email protected]>
Fixes: #58592