From 2301adaa41a296e5b84b7adf2318ed4a8b486a18 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 15 Feb 2026 11:45:05 +0000 Subject: [PATCH 1/3] ci: document Node 22 exclusion for shared builtin job --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8109c204e2b..83b53846a3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,6 +269,8 @@ jobs: fail-fast: false max-parallel: 0 matrix: + # Node.js 22 is intentionally excluded here: --shared-builtin-undici/undici-path + # embedding is only validated for supported/current majors. node-version: ['24', '25'] runs-on: ['ubuntu-latest'] with: From d627857456389e6861c69bc5f258f7cb353410f1 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 15 Feb 2026 21:43:16 +0000 Subject: [PATCH 2/3] fix: support legacy dispatch handlers and request statusText --- lib/api/api-request.js | 3 ++- lib/dispatcher/dispatcher-base.js | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/api/api-request.js b/lib/api/api-request.js index b75a6dcae0e..dc944640332 100644 --- a/lib/api/api-request.js +++ b/lib/api/api-request.js @@ -87,7 +87,7 @@ class RequestHandler extends AsyncResource { this.context = context } - onResponseStart (controller, statusCode, headers, _statusMessage) { + onResponseStart (controller, statusCode, headers, statusText) { const { callback, opaque, context, responseHeaders, highWaterMark } = this const rawHeaders = controller?.rawHeaders @@ -126,6 +126,7 @@ class RequestHandler extends AsyncResource { try { this.runInAsyncScope(callback, null, null, { statusCode, + statusText, headers: responseHeaderData, trailers: this.trailers, opaque, diff --git a/lib/dispatcher/dispatcher-base.js b/lib/dispatcher/dispatcher-base.js index 59ad3abd046..ec8868ca371 100644 --- a/lib/dispatcher/dispatcher-base.js +++ b/lib/dispatcher/dispatcher-base.js @@ -7,6 +7,7 @@ const { InvalidArgumentError } = require('../core/errors') const { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require('../core/symbols') +const Dispatcher1Wrapper = require('./dispatcher1-wrapper') const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -129,9 +130,7 @@ class DispatcherBase extends Dispatcher { } dispatch (opts, handler) { - if (!handler || typeof handler !== 'object') { - throw new InvalidArgumentError('handler must be an object') - } + const wrappedHandler = Dispatcher1Wrapper.wrapHandler(handler) try { if (!opts || typeof opts !== 'object') { @@ -146,13 +145,13 @@ class DispatcherBase extends Dispatcher { throw new ClientClosedError() } - return this[kDispatch](opts, handler) + return this[kDispatch](opts, wrappedHandler) } catch (err) { - if (typeof handler.onResponseError !== 'function') { + if (typeof wrappedHandler.onResponseError !== 'function') { throw err } - handler.onResponseError(null, err) + wrappedHandler.onResponseError(null, err) return false } From 257a6a0711002c90fb3accae0e98196a80f03774 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 15 Feb 2026 21:48:09 +0000 Subject: [PATCH 3/3] test: use v2 dispatch handlers in h2 ping tests --- lib/dispatcher/dispatcher-base.js | 11 +++---- test/http2-dispatcher.js | 48 ++++++++++--------------------- 2 files changed, 21 insertions(+), 38 deletions(-) diff --git a/lib/dispatcher/dispatcher-base.js b/lib/dispatcher/dispatcher-base.js index ec8868ca371..59ad3abd046 100644 --- a/lib/dispatcher/dispatcher-base.js +++ b/lib/dispatcher/dispatcher-base.js @@ -7,7 +7,6 @@ const { InvalidArgumentError } = require('../core/errors') const { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require('../core/symbols') -const Dispatcher1Wrapper = require('./dispatcher1-wrapper') const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -130,7 +129,9 @@ class DispatcherBase extends Dispatcher { } dispatch (opts, handler) { - const wrappedHandler = Dispatcher1Wrapper.wrapHandler(handler) + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } try { if (!opts || typeof opts !== 'object') { @@ -145,13 +146,13 @@ class DispatcherBase extends Dispatcher { throw new ClientClosedError() } - return this[kDispatch](opts, wrappedHandler) + return this[kDispatch](opts, handler) } catch (err) { - if (typeof wrappedHandler.onResponseError !== 'function') { + if (typeof handler.onResponseError !== 'function') { throw err } - wrappedHandler.onResponseError(null, err) + handler.onResponseError(null, err) return false } diff --git a/test/http2-dispatcher.js b/test/http2-dispatcher.js index 0c85fc2afab..bef6c623e55 100644 --- a/test/http2-dispatcher.js +++ b/test/http2-dispatcher.js @@ -511,19 +511,13 @@ test('Should send http2 PING frames', async t => { method: 'PUT', body: 'hello' }, { - onConnect () { - - }, - onHeaders () { - return true - }, - onData () { - return true - }, - onComplete (trailers) { + onRequestStart () {}, + onResponseStart () {}, + onResponseData () {}, + onResponseEnd (_controller, trailers) { t.strictEqual(trailers['x-trailer'], 'hello') }, - onError (err) { + onResponseError (_controller, err) { t.ifError(err) } }) @@ -588,19 +582,13 @@ test('Should not send http2 PING frames if interval === 0', async t => { method: 'PUT', body: 'hello' }, { - onConnect () { - - }, - onHeaders () { - return true - }, - onData () { - return true - }, - onComplete (trailers) { + onRequestStart () {}, + onResponseStart () {}, + onResponseData () {}, + onResponseEnd (_controller, trailers) { t.strictEqual(trailers['x-trailer'], 'hello') }, - onError (err) { + onResponseError (_controller, err) { t.ifError(err) } }) @@ -666,19 +654,13 @@ test('Should not send http2 PING frames after connection is closed', async t => method: 'PUT', body: 'hello' }, { - onConnect () { - - }, - onHeaders () { - return true - }, - onData () { - return true - }, - onComplete (trailers) { + onRequestStart () {}, + onResponseStart () {}, + onResponseData () {}, + onResponseEnd (_controller, trailers) { t.strictEqual(trailers['x-trailer'], 'hello') }, - onError (err) { + onResponseError (_controller, err) { t.ifError(err) } })