Darshan Sen
ccf227eac8
http2: add diagnostics channel 'http2.client.stream.finish'
...
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58317
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-05-18 13:04:59 +05:30
Livia Medeiros
b0cf2e2250
worker: give names to MessagePort functions
...
PR-URL: https://github.com/nodejs/node/pull/58307
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com >
2025-05-17 04:41:25 +00:00
Chengzhong Wu
a436f7b492
fs: unexpose internal constants
...
`EXTENSIONLESS_FORMAT_JAVASCRIPT` and `EXTENSIONLESS_FORMAT_WASM` are
only used internally through binding `getFormatOfExtensionlessFile`.
They should not be exposed publicly.
PR-URL: https://github.com/nodejs/node/pull/58327
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2025-05-16 19:40:17 +00:00
Darshan Sen
8053a5c1c7
http2: add diagnostics channel 'http2.client.stream.error'
...
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58306
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tierney Cyren <hello@bnb.im >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
2025-05-16 12:15:50 +00:00
Carlos Espa
b6189c352c
module: clarify cjs global-like error on ModuleJobSync
...
PR-URL: https://github.com/nodejs/node/pull/56491
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2025-05-16 06:39:28 +00:00
Darshan Sen
b1973550e0
http2: add diagnostics channel 'http2.client.stream.start'
...
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58292
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2025-05-14 07:41:42 +00:00
Dario Piotrowicz
ae8a6de609
watch: fix watch args not being properly filtered
...
currently when --watch is used, the argv arguments that
the target script receives are filtered so that they don't
include watch related arguments, however the current
filtering logic is incorrect and it causes some watch values
to incorrectly pass the filtering, the changes here address
such issue
PR-URL: https://github.com/nodejs/node/pull/58279
Fixes: https://github.com/nodejs/node/issues/57124
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-13 13:52:46 +00:00
Livia Medeiros
cfd2021c35
http,https: give names to anonymous or misnamed functions
...
Affected functions:
- http.OutgoingMessage.prototype.cork
- http.OutgoingMessage.prototype.uncork
- http.Server.prototype.close
- http.Server.prototype.closeAllConnections
- http.Server.prototype.closeIdleConnections
- http.Server.prototype[Symbol.asyncDispose]
- http.Server.prototype[nodejs.rejection]
- http.validateHeaderName
- http.validateHeaderValue
- https.Server.prototype.closeAllConnections
- https.Server.prototype.closeIdleConnections
- https.Server.prototype.close
PR-URL: https://github.com/nodejs/node/pull/58180
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-12 12:28:05 +00:00
Livia Medeiros
91d2400c74
buffer: give names to Buffer.prototype.*Write() functions
...
PR-URL: https://github.com/nodejs/node/pull/58258
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jordan Harband <ljharb@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com >
2025-05-12 07:02:23 +00:00
Antoine du Hamel
3ad7362012
fs: add support for URL for fs.glob's cwd option
...
PR-URL: https://github.com/nodejs/node/pull/58182
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jason Zhang <xzha4350@gmail.com >
2025-05-11 17:29:45 +00:00
Antoine du Hamel
4a86be255c
fs: add to Dir support for explicit resource management
...
PR-URL: https://github.com/nodejs/node/pull/58206
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
2025-05-11 14:53:21 +00:00
Darshan Sen
5f841fb2c8
http2: add diagnostics channel 'http2.client.stream.created'
...
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58246
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2025-05-11 08:38:15 +00:00
Dario Piotrowicz
a822a1cbe7
lib: deprecate _tls_common and _tls_wrap
...
runtime deprecate the _tls_common and _tls_wrap
modules, users should use nust node:tls insteal
and internally internal/tls/commond and
internal/tls/wrap should be used instead
PR-URL: https://github.com/nodejs/node/pull/57643
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2025-05-10 23:10:43 +00:00
Théo LUDWIG
6710c00e56
fs: glob is stable, so should not emit experimental warnings
...
PR-URL: https://github.com/nodejs/node/pull/58236
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-05-10 14:37:27 +00:00
Antoine du Hamel
942862f287
fs: ensure dir.read() does not throw synchronously
...
PR-URL: https://github.com/nodejs/node/pull/58228
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-05-10 10:37:32 +02:00
Filip Skokan
daced4ab98
buffer: move SlowBuffer to EOL
...
This commits reverts da69d13623
PR-URL: https://github.com/nodejs/node/pull/58220
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2025-05-09 19:41:31 +00:00
Théo LUDWIG
264cad75ce
Revert "test_runner: change ts default glob"
...
This reverts commit 9df0ff7015 .
PR-URL: https://github.com/nodejs/node/pull/58202
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
2025-05-09 05:54:29 +00:00
Joyee Cheung
e0766f9a73
module: handle instantiated async module jobs in require(esm)
...
When require(esm) encounters a cached module job that is instantiated
but not yet evaluated, run the evaluation. This catches an edge case
previously missed in https://github.com/nodejs/node/pull/57187 .
PR-URL: https://github.com/nodejs/node/pull/58067
Fixes: https://github.com/nodejs/node/issues/58061
Reviewed-By: Jacob Smith <jacob@frende.me >
2025-05-08 20:10:32 +00:00
Marco Ippolito
8ccfcb5adc
lib: fix sourcemaps with ts module mocking
...
PR-URL: https://github.com/nodejs/node/pull/58193
Fixes: https://github.com/nodejs/node/issues/58119
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-05-08 15:14:22 +00:00
Filip Skokan
da69d13623
Revert "buffer: move SlowBuffer to EOL"
...
This reverts commit 647175ee0b .
PR-URL: https://github.com/nodejs/node/pull/58211
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2025-05-07 19:31:21 +00:00
Tobias Nießen
0050addb1f
crypto: merge CipherBase.initiv into constructor
...
Now that `CipherBase.init` has been removed, instances of the class are
always initialized by a call to `initiv` immediately after the
constructor has returned. Instead of calling into C++ twice from
`createCipherBase`, pass all required arguments to the constructor and
fully initialize the instance before the constructor returns.
PR-URL: https://github.com/nodejs/node/pull/58166
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-07 16:13:29 +00:00
James M Snell
b21574d63b
assert: move CallTracker to EOL
...
The `assert.CallTracker` API has been deprecateed since v20. The
`node:test` `mock.fn` API provides a better alternative for the
functionality.
PR-URL: https://github.com/nodejs/node/pull/58006
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com >
2025-05-06 20:28:02 -07:00
Joyee Cheung
4bfcad1ac5
Revert "watch: fix watch args not being properly filtered"
...
This reverts commit 4acb854039 .
PR-URL: https://github.com/nodejs/node/pull/58190
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com >
2025-05-06 18:28:19 +00:00
Gerhard Stöbich
a0d458e448
async_hooks: ensure AsyncLocalStore instances work isolated
...
Avoid that one AsyncLocalStore instance changes the state of another
AsyncLocalStore instance by restoring only the owned store instead
the complete AsyncContextFrame.
PR-URL: https://github.com/nodejs/node/pull/58149
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2025-05-06 18:00:56 +00:00
Pietro Marchini
7e24ebc780
test_runner: unify --require and --import behavior when isolation none
...
PR-URL: https://github.com/nodejs/node/pull/57924
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-05-06 06:28:29 +00:00
Dario Piotrowicz
4acb854039
watch: fix watch args not being properly filtered
...
currently when --watch is used, the argv arguments that
the target script receives are filtered so that they don't
include watch related arguments, however the current
filtering logic is incorrect and it causes some watch values
to incorrectly pass the filtering, the changes here address
such issue
PR-URL: https://github.com/nodejs/node/pull/57936
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2025-05-05 15:08:04 +00:00
Giovanni
995ad2b053
repl: add proper vertical cursor movements
...
PR-URL: https://github.com/nodejs/node/pull/58003
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
2025-05-04 18:42:07 +00:00
Giovanni
96be7836d7
repl: add possibility to edit multiline commands while adding them
...
PR-URL: https://github.com/nodejs/node/pull/58003
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
2025-05-04 18:42:06 +00:00
Yukihiro Hasegawa
6de55f7ffb
doc: update return types for eventNames method in EventEmitter
...
PR-URL: https://github.com/nodejs/node/pull/58083
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
2025-05-04 13:42:47 +00:00
LiviaMedeiros
a44ccacb43
http2: give name to promisified connect()
...
PR-URL: https://github.com/nodejs/node/pull/57916
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-04 08:25:11 +00:00
LiviaMedeiros
dd62456e22
child_process: give names to promisified exec() and execFile()
...
PR-URL: https://github.com/nodejs/node/pull/57916
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-04 08:25:10 +00:00
LiviaMedeiros
40a657b330
util: add internal assignFunctionName() function
...
PR-URL: https://github.com/nodejs/node/pull/57916
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-04 08:25:09 +00:00
Giovanni Bucci
723d7bb542
url: improve performance of the format function
...
PR-URL: https://github.com/nodejs/node/pull/57099
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2025-05-03 14:28:20 +00:00
Chengzhong Wu
a7cbb90474
lib: avoid StackOverflow on serializeError
...
`serializeError` should avoid StackOverflow and the test should not
rely on `--stack-size`.
PR-URL: https://github.com/nodejs/node/pull/58075
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2025-04-29 21:12:29 +00:00
Antoine du Hamel
50cfc6ca63
esm: avoid import.meta setup costs for unused properties
...
PR-URL: https://github.com/nodejs/node/pull/57286
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com >
2025-04-29 22:55:33 +02:00
Yagiz Nizipli
5ed1bcbd9b
src: fix internalModuleStat v8 fast path
...
PR-URL: https://github.com/nodejs/node/pull/58054
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2025-04-29 17:53:12 +00:00
Chengzhong Wu
8e7ae60e3b
async_hooks: enable AsyncLocalStorage once constructed
...
This fixes the leak behavior when using `enterWith` when no
`AsyncLocalStorage`s were enabled inside a promise.
PR-URL: https://github.com/nodejs/node/pull/58029
Fixes: https://github.com/nodejs/node/issues/53037
Refs: https://github.com/nodejs/node/pull/58019
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-27 21:43:28 +00:00
James M Snell
647175ee0b
buffer: move SlowBuffer to EOL
...
`SlowBuffer` has been deprecated for many years now. Let's remove it.
PR-URL: https://github.com/nodejs/node/pull/58008
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-04-27 07:40:37 -07:00
Tim Perry
4cd8e1914a
http2: add raw header array support to h2Session.request()
...
This also notably changes error handling for request(). Previously some
invalid header values (but not all) would cause the session to be
unnecessarily destroyed automatically, e.g. passing an unparseable
header name to request(). This is no longer the case: header validation
failures will throw an error, but will not destroy the session or emit
'error' events.
PR-URL: https://github.com/nodejs/node/pull/57917
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-26 09:27:27 -07:00
0hm☘️🏳️⚧️
a8a86b3adb
lib: resolve the issue of not adhering to the specified buffer size
...
We create a `queueHandler`, and in every iteration we execute
the handlers in the `queueHandler` until we get a non-null result.
PR-URL: https://github.com/nodejs/node/pull/55896
Refs: https://github.com/nodejs/node/issues/55764
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-26 15:38:15 +00:00
Jacob Smith
cf896c3b12
test_runner: support mocking json modules
...
PR-URL: https://github.com/nodejs/node/pull/58007
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2025-04-26 14:56:24 +00:00
Dario Piotrowicz
b673c697a7
Revert "readline: add stricter validation for functions called after closed"
...
This reverts commit 8e7f32f968 .
PR-URL: https://github.com/nodejs/node/pull/58024
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2025-04-25 22:45:58 +00:00
Dario Piotrowicz
b665127963
watch: clarify completion/failure watch mode messages
...
clarify the messages that `node --watch` presents to the user
when the process terminates (either successfully or because of
some error) by clearly conveying that node is waiting for new
file changes before restarting the process
PR-URL: https://github.com/nodejs/node/pull/57926
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2025-04-24 14:00:24 +00:00
Antoine du Hamel
5d15cbb416
crypto: fix cross-realm SharedArrayBuffer validation
...
PR-URL: https://github.com/nodejs/node/pull/57974
Reviewed-By: Jordan Harband <ljharb@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2025-04-24 13:28:51 +00:00
Dario Piotrowicz
8e7f32f968
readline: add stricter validation for functions called after closed
...
PR-URL: https://github.com/nodejs/node/pull/57680
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2025-04-22 19:27:58 -07:00
Felipe Forbeck
6bf7fd7f4e
crypto: fix cross-realm check of ArrayBuffer
...
This patch modifies the `isNonSharedArrayBuffer` function in the WebIDL
implementation for the SubtleCrypto API to properly handle `ArrayBuffer`
instances created in different JavaScript realms.
Before this fix, when a `TypedArray.buffer` from a different realm
(e.g., from a VM context or worker thread) was passed to
`SubtleCrypto.digest()`, it would fail with:
> TypeError: Failed to execute 'digest' on 'SubtleCrypto': 2nd argument
> is not instance of ArrayBuffer, Buffer, TypedArray, or DataView."
The fix use the `isArrayBuffer` function from `internal/util/types` to
detect cross-realm `ArrayBuffer` instances when the prototype chain
check fails.
PR-URL: https://github.com/nodejs/node/pull/57828
Refs: https://github.com/storacha/w3up/issues/1591
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jordan Harband <ljharb@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2025-04-22 15:01:21 +02:00
Wiyeong Seo
7102ea1559
os: fix netmask format check condition in getCIDR function
...
Modified to check the format of the netmask instead
of just checking that each part of the netmask is even
PR-URL: https://github.com/nodejs/node/pull/57324
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-20 05:54:48 +00:00
Kushagra Pandey
609df89cd3
http2: session tracking and graceful server close
...
This change adds proper tracking of HTTP / 2 server sessions
to ensure they are gracefully closed when the server is
shut down.It implements:
- A new kSessions symbol for tracking active sessions
- Adding/removing sessions from a SafeSet in the server
- A closeAllSessions helper function to close active sessions
- Updates to Http2Server and Http2SecureServer close methods
Breaking Change: any client trying to create new requests
on existing connections will not be able to do so once
server close is initiated
Refs: https://datatracker.ietf.org/doc/html/rfc7540\#section-9.1
Refs: https://nodejs.org/api/http.html\#serverclosecallback
- improve HTTP/2 server shutdown to prevent race conditions
1. Fix server shutdown race condition
- Stop listening for new connections before closing existing ones
- Ensure server.close() properly completes in all scenarios
2. Improve HTTP/2 tests
- Replace setTimeout with event-based flow control
- Simplify test logic for better readability
- Add clear state tracking for event ordering
- Improve assertions to verify correct shutdown sequence
This eliminates a race condition where new sessions could connect
between the time existing sessions are closed and the server stops
listening, potentially preventing the server from fully shutting down.
- fix cross-platform test timing issues
Fix test-http2-server-http1-client.js failure on Ubuntu
by deferring server.close() to next event loop cycle.
The issue only affected Ubuntu where session close occurs
before error emission, causing the test to miss errors
when HTTP/1 clients connect to HTTP/2 servers.
Using setImmediate() ensures error events fire before
server close across all platforms while maintaining
recent session handling improvements.
PR-URL: https://github.com/nodejs/node/pull/57586
Fixes: https://github.com/nodejs/node/issues/57611
Refs: https://datatracker.ietf.org/doc/html/rfc7540#section-9.1
Refs: https://nodejs.org/api/http.html#serverclosecallback
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-19 10:17:12 -07:00
Livia Medeiros
afd318db67
assert: support Float16Array in loose deep equality checks
...
PR-URL: https://github.com/nodejs/node/pull/57881
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-04-19 17:04:03 +00:00
Kushagra Pandey
2acc8bc6a9
http2: fix graceful session close
...
Fix issue where session.close() prematurely destroys the session
when response.end() was called with an empty payload while active
http2 streams still existed. This change ensures that sessions are
closed gracefully only after all http2 streams complete and clients
properly receive the GOAWAY frame as per the HTTP/2 spec.
Refs: https://nodejs.org/api/http2.html\#http2sessionclosecallback
PR-URL: https://github.com/nodejs/node/pull/57808
Fixes: https://github.com/nodejs/node/issues/57809
Refs: https://nodejs.org/api/http2.html%5C#http2sessionclosecallback
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-19 16:36:03 +00:00