Commit Graph
49734 Commits
Author SHA1 Message Date
JuHyeong424 dd2554d704 dgram: fix abort on negative zero buffer size
The size check accepts -0, but the binding asserts IsUint32(),
which V8 reports as false for -0, so setRecvBufferSize(-0) and
setSendBufferSize(-0) abort the process. Coerce the value to +0.

Signed-off-by: JuHyeong424 <wkdwngud963@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67662
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-24 18:20:13 +01:00
Ved Chaudhari b92011655a stream: reject operators on empty streams with aborted signal
Stream operators given an already-aborted signal resolved instead of
rejecting when the stream was empty, because the signal was only
checked once a chunk arrived. Check it up front in map() and toArray(),
which the other operators are built on.

Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67637
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-24 18:20:13 +01:00
James M Snell 5d59d00c78 test: make test-doc-api-json more robust
The test hard coded the number of deprecated apis
so whenever one is added or removed it always needs
to be updated. This makes the check more robust by
calculating the values on each run.

Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67701
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2026-11-24 18:20:13 +01:00
Node.js GitHub Bot 91414a11aa deps: update histogram to 0.12.1
PR-URL: https://github.com/nodejs/node/pull/66818
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-24 18:20:12 +01:00
Yohannes DestaandAlberto Moretti f6d72af926 fs: report EROFS from recursive mkdir()
A recursive mkdir() that hits a read-only file system treated EROFS like
any unknown error: it stat()ed the missing path and reported the ENOENT
from that instead. Return EROFS straight away, as mkdir() already does
for EACCES, ENOSPC, ENOTDIR and EPERM.

The test uses a read-only file system that is already mounted (listed
in /proc/self/mounts on Linux, the system volume on macOS) and skips
when there is none, since mounting one needs root.

Fixes: https://github.com/nodejs/node/issues/47098
Refs: https://github.com/nodejs/node/pull/48105
Refs: https://github.com/nodejs/node/pull/62725
Co-authored-by: Alberto Moretti <moretti919@gmail.com>
Signed-off-by: Yohannes Desta <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67500
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-11-24 18:20:12 +01:00
Node.js GitHub Bot 07fc4c9052 test: update test426-fixtures to bc255a703449b2bc10989772d940df5bf37acf4
PR-URL: https://github.com/nodejs/node/pull/67687
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-24 18:20:12 +01:00
Roberto Bianchi cadf10a9ce lib: use indexed append in ZIP central directory parser
readCentralDirectory() appends one CentralFileHeader per archive entry
with ArrayPrototypePush, which is listed among primordials with known
performance issues. Assign by the existing loop index instead. The
loop runs once per entry, so its trip count grows with archive size.

The change is limited to this loop. Validation and error behavior are
unchanged.

Assisted-by: Claude Code
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/67456
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-11-24 18:20:12 +01:00
Yuya Inoue 598aa2941b doc: fix http response.writeProcessing() description
The description of response.writeProcessing() was copied from
response.writeContinue() and said that the request body should be
sent, which is what 100 Continue means, not 102 Processing.

Describe what 102 means, document the callback that both methods
have always accepted, and point to the equivalent
response.writeInformation() call.

Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Claude Code
PR-URL: https://github.com/nodejs/node/pull/67705
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-24 18:20:12 +01:00
Ilyas Shabi dabbbee0fb src: speed up heap profile serialization
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67685
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-24 18:20:02 +01:00
René 34ee914a08 tools: set GHA cache to readonly in stress-test workflow
Signed-off-by: René <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67694
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-24 09:52:00 +01:00
René a28558e322 tools: cache Rust builds in GHA workflows
Signed-off-by: René <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67694
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-24 09:52:00 +01:00
René 3e4242ee6f tools: update sccache to 0.19.0
Signed-off-by: René <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67694
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-24 09:52:00 +01:00
Rafael Gonzaga 83454d9ec2 src,permission: throw remaining fs errors async
These APIs were missed in https://github.com/nodejs/node/pull/52730.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/67037
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-24 09:52:00 +01:00
Yohannes DestaandNicholas Paun e0921d226f fs: stat src through symlinks in cpSync() when dereference is set
CpSyncCheckPaths() used symlink_status() for src when dereference was
true and status() when it was false, the reverse of what the option
means. #59681 fixed the same swap for dest but left src as it was.
A symlink to a file passed as src with dereference: true was treated
as a directory, so cpSync() threw ERR_FS_EISDIR unless recursive was
set, while fs.cp() copied the file.

Swap the two calls and drop the check that counted a symlink as a
directory, which status() can no longer return.

Refs: https://github.com/nodejs/node/issues/59168
Refs: https://github.com/nodejs/node/pull/60945
Co-authored-by: Nicholas Paun <npaun@cloudflare.com>
Signed-off-by: yohannesjoya <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67340
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2026-11-24 09:52:00 +01:00
Node.js GitHub Bot 7e7bd82177 test: update WPT for WebCryptoAPI to 4ba9d1b8e4
PR-URL: https://github.com/nodejs/node/pull/67686
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-11-24 09:52:00 +01:00
Node.js GitHub Bot 63548fb8f0 deps: update nbytes to 0.1.5
PR-URL: https://github.com/nodejs/node/pull/67688
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-24 09:52:00 +01:00
Node.js GitHub Bot bc8732f31d deps: update zlib to 1.4-401d185
PR-URL: https://github.com/nodejs/node/pull/67689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-24 09:52:00 +01:00
Node.js GitHub Bot ebad21ba08 deps: update simdjson to 5.2.0
PR-URL: https://github.com/nodejs/node/pull/67690
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-24 09:51:59 +01:00
Node.js GitHub Bot 98d2bf0f5c tools: update nixpkgs-unstable to 93a9ed0a866099a230ed5146a5bb7d16fd5
PR-URL: https://github.com/nodejs/node/pull/67691
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-11-24 09:51:59 +01:00
Node.js GitHub Bot f230732dec deps: update undici to 8.13.1
PR-URL: https://github.com/nodejs/node/pull/67692
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-24 09:51:59 +01:00
Antoine du Hamel d9540f53db tools: pin Cachix version on x86_64_darwin
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67738
Fixes: https://github.com/nodejs/node/issues/67735
Refs: https://github.com/cachix/cachix/commit/e3609f93799354c50e4126d6423ede6dd317e2f2
Refs: https://github.com/cachix/cachix-action/issues/224
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-24 09:51:49 +01:00
Gürgün Dayıoğlu 3949e0a04c src: cache trace category lookups on hot paths
The sync fs, fs dir, AsyncWrap and vm.Script tracing guards called
TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED directly, which does a
by-name search in the tracing controller on every call. Use
TRACE_EVENT_CATEGORY_ENABLED instead, which caches the category
pointer per call site like the other TRACE_EVENT macros. Perfetto
already provides it; add an equivalent for the legacy tracing build.

Assisted-by: claude:opus-5.5
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
PR-URL: https://github.com/nodejs/node/pull/67502
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-24 09:51:49 +01:00
dennev 5b15842d98 http: do not reuse expired free sockets
A free socket with an idle timeout is normally destroyed by its timer.
When the event loop is blocked long enough for that timeout to expire,
the timer cannot run, and `addRequest()` can reuse the socket even
though the server may already have closed the connection. This can
cause the request to fail with `ECONNRESET`.

Record when a socket enters the free pool and, before reuse, remove and
destroy a free socket whose idle timeout has expired according to the
timers' clock.

Refs: https://github.com/nodejs/node/issues/54293
Assisted-by: a closed-source coding agent
Signed-off-by: dennev <dennev13@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67292
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-24 09:51:49 +01:00
Vladimir Morozov aebf09250d build: keep PGO settings out of addon builds
Gate PGO generation and use flags on configuring_node so native addons
do not inherit Node.js-specific profiling settings from process.config.
The inherited Windows profile-use option is unquoted and breaks addon
builds when their paths contain spaces.

Preserve Node.js PGO flags and the Windows host-toolset exclusion.
Expand configuring_node early for the Windows target condition.

Refs: https://github.com/nodejs/node-addon-api/pull/1763
Signed-off-by: Vladimir Morozov <vmorozov@microsoft.com>
Assisted-by: AI coding assistant
PR-URL: https://github.com/nodejs/node/pull/67638
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2026-11-24 09:51:49 +01:00
Rafael Gonzaga 05f33bf366 path: avoid building error label per argument in resolve
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66616
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-24 09:51:49 +01:00
RafaelGSS 72a6423a28 child_process: copy split permission flag values
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66725
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-24 09:51:48 +01:00
Yaroslav Chuhai dbeb6e49bb url: keep urlToHttpOptions() result in fast mode
urlToHttpOptions() built its result with `__proto__: null` ahead of a
spread, which makes V8 create the object in dictionary mode. Every
http.request() and https.request() called with a string or URL goes
through it, and ClientRequest immediately copies the result, so both
the property stores and the copy took the slow path.

Use `__proto__: kEmptyObject` instead, as ClientRequest already does
for its option copies. The object stays in fast mode and still
inherits nothing.

Signed-off-by: Yaroslav Chuhai <yaroslavchuhai@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67683
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-24 09:51:48 +01:00
Hamza Kargin 76b0d6c519 stream: retry read after construct when hwm is 0
A read() made while construct() is pending is refused and leaves
needReadable set. After construction, maybeReadMore() does not read
for a non-flowing stream with highWaterMark: 0, so _read() was never
called and consumers such as toArray() or for await waited forever.

Retry the refused read once construction finishes when highWaterMark
is 0.

Fixes: https://github.com/nodejs/node/issues/67668
Assisted-by: AI coding agents
Signed-off-by: Hamza Kargın <hamzakargin@outlook.com>
PR-URL: https://github.com/nodejs/node/pull/67670
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-24 09:51:48 +01:00
Paolo Insogna 2f5991e1ca http: compute body chunk length from decoded bytes
Convert base64, base64url and hex strings to a Buffer before computing
the chunk length, so the announced length matches the bytes written
even when the input contains characters skipped while decoding.

Assisted-By: OpenAI GPT-5.6 Sol <openai/gpt-5.6-sol>
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
PR-URL: https://github.com/nodejs/node/pull/67615
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-24 09:51:48 +01:00
Rafael Gonzaga ebde3933a4 permission: reject empty reference in drop()
An empty reference passed to process.permission.drop() fell through to
dropping the whole scope, while has() treats it as not granted. Throw
ERR_INVALID_ARG_VALUE instead, in both the JS wrapper and the binding.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66732
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-24 09:51:48 +01:00
Chengzhong Wu 8e620b994b lib: implement source map scopes decoder
Implements the stage 3 https://github.com/tc39/ecma426/blob/main/proposals/scopes.md
proposal decoder. This does not implement the stack trace formatter of
the scopes. The stack trace formatter will be in a follow-up.

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67594
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-24 09:51:48 +01:00
Chengzhong Wu e18a140916 lib: move source map VLQ decoding into its own module
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67594
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-24 09:51:48 +01:00
Zelalem Habtamu fc28b7070c os: fix abort on negative zero pid or priority
Fixes: https://github.com/nodejs/node/issues/67648
Assisted-by: Claude Code
Signed-off-by: Zelalem Habtamu <zelalemhab19@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67651
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2026-11-24 09:51:48 +01:00
Christian Aurich Zanettini Martins 01470de44d build: re-run configure to regenerate out/Makefile
The out/Makefile rule runs gyp directly, without -Dconfiguring_node=1
and the other arguments configure.py passes. After a gyp file or
configure.py changes, the makefiles lose -fPIE and -pie, every object
is rebuilt, and node is only a PIE if the compiler defaults to it.

config.status writes config.gypi and out/Makefile together, so list
the gyp files under config.gypi and have out/Makefile depend on it
alone. out/Makefile only re-runs config.status itself when it is
missing or not newer than config.gypi, as after make clean. Building
through make with --ninja now also regenerates build.ninja after a
gyp change.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67534
Refs: https://github.com/nodejs/node/pull/67386
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-24 09:51:48 +01:00
Yuya Inoue c8f38fac87 test: keep response open in http2 response limits test
The server ended the response before the request body arrived, so it
also sent RST_STREAM(NO_ERROR). When that frame reaches the client in
the same read as the rejected headers, the stream is closed by the
peer reset before the client's own reset is sent. On v26.x the request
then closes without an 'error' event and the test times out.

Leave the response open so that only the client resets the stream.

Refs: https://github.com/nodejs/node/pull/67114
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Claude Code
PR-URL: https://github.com/nodejs/node/pull/67656
Refs: https://github.com/nodejs/node/actions/runs/44631511460
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-24 09:51:37 +01:00
Christian Aurich Zanettini Martins 10394eea40 quic: fix abort on handshake failure in connect()
Endpoint::Connect() marked the session as wrapped before sending the
first flight, while JavaScript had no QuicSession for it yet. If the
session closed during that send, for example with ciphers: '', nothing
called destroy() and the CHECK in Session::EmitClose() aborted the
process. Send the first flight before marking the session as wrapped,
so connect() rejects with ERR_QUIC_CONNECTION_FAILED instead.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67617
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-23 12:34:29 +01:00
Nigro Simone 6abd8c49e3 src: skip the async id stack when nobody sees it
With no async hook and no executionAsyncResource() user, every
InternalCallbackScope pushed and popped the async ids on the stack, only
for executionAsyncId() and triggerAsyncId() to read the top. Swap the
two ids in place instead: they are all that those two and
process.nextTick() read. executionAsyncResource() is the only reader of
the stack: the scopes that skip it form a chain in AsyncHooks, counted
in a new field, kLazyScopes, and JS asks C++ for the innermost one only
while that count is not zero. The checks for a corrupted stack stay.

Refs: https://github.com/nodejs/performance/issues/24
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66511
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-23 12:34:29 +01:00
Hamza Kargin ccd7a5d3aa fs: read data when highWaterMark is 0
ReadStream.prototype._read() passed the requested size straight to
the end-of-range check, so a size of 0 ended the stream before any
data was read. This happened for createReadStream() with
highWaterMark: 0, and since #66956 for every fs.ReadStream after
stream.setDefaultHighWaterMark(false, 0).

Read 64 KiB, the ReadStream default, when the requested size is 0.

Fixes: https://github.com/nodejs/node/issues/67667
Refs: https://github.com/nodejs/node/pull/66956
Assisted-by: AI coding agents
Signed-off-by: Hamza Kargın <hamzakargin@outlook.com>
PR-URL: https://github.com/nodejs/node/pull/67669
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-23 12:34:29 +01:00
Mattias Buelens 3a8a88e1cc stream: fix stale byte stream queue size
Re-read the byte controller's queue size before filling each pending
read request. A released BYOB reader can leave a partially filled
pull-into descriptor that is enqueued while a default reader has
multiple pending reads. Caching the queue size causes the loop to
dequeue from an empty queue after fulfilling the first read request.

Add a regression test for one, two, and three pending reads and verify
that any remaining queued bytes are preserved.

Signed-off-by: Mattias Buelens <mattias@buelens.com>
PR-URL: https://github.com/nodejs/node/pull/67499
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-23 12:34:29 +01:00
Nigro Simone 03eab40fa4 stream: run a replaced write() in the flowing pipe
pipe() calls dest.write(). The fast path of a flowing pipe hands the
chunks of a source that pushes from _read() to dest._write() directly,
so a write() replaced on the instance or overridden in a subclass no
longer runs. A response that is a Writable, wrapped by compression
middleware, sent a gzip body with uncompressed chunks in it.

Take the fast path only when write() is Writable.prototype.write.

Refs: https://github.com/nodejs/node/pull/66182
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66596
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-23 12:34:29 +01:00
Tamir Duberstein c763009def test: check the TLS server name on address-family fallback locally
The TLS address-selection test connects to nodejs.org twice. A reset
can fail the test before the handshake completes, and the addresses
returned by DNS determine whether the client ever tries a second one.

Run a TLS server on IPv4 loopback. With address-family selection
enabled, return IPv6 loopback first so the client has to switch TCP
handles. Check which server name reaches the server and keep certificate
verification enabled on the client.

Refs: https://github.com/nodejs/node/issues/46679
Assisted-by: Codex
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67595
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-23 12:34:29 +01:00
James M Snell 40d7e2d235 lib: graduate the --process-timeout option
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67506
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-23 12:34:28 +01:00
Christian Aurich Zanettini Martins 5062ac2f9a fs: fix abort on negative zero write length
`validateOffsetLengthWrite()` accepts -0 as a length, but V8 does not
represent -0 as an Int32 value, so the `IsInt32()` check in the binding
aborted the process in `fs.write()`, `fs.writeSync()` and
`filehandle.write()`.

Coerce the validated length to an int32 before the call, as `fs.read()`
already does.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67524
Refs: https://github.com/nodejs/node/pull/65888
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-23 12:34:28 +01:00
Daniel Lemire 76ab721fe7 src: reserve simdjson padding in parsePackageJSON
`parsePackageJSON()` copies its input into a `std::string` with no
spare capacity. `simdjson::pad()` then appends `SIMDJSON_PADDING`
spaces, so every call reallocated and copied the whole document.
Reserve room for the padding when the input is copied so that the
append happens in place. The padding stays within the string's size,
so simdjson never reads past the end of the string.

Add a benchmark that parses the package.json files under deps/.

Assisted-by: an AI coding agent
Signed-off-by: Daniel Lemire <daniel@lemire.me>
PR-URL: https://github.com/nodejs/node/pull/67623
Refs: https://github.com/nodejs/node/issues/55584
Refs: https://github.com/nodejs/node/pull/55591
Refs: https://github.com/nodejs/node/pull/67620
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-23 12:34:28 +01:00
Paolo Insogna 930a71cb55 https: encode all TLS fields in agent names
`https.Agent#getName()` joined several TLS options with `:` without
encoding them, so a value containing `:` could shift into the next field
and produce the same name as a different set of options. A `DataView`
passed as `dhparam` was also reduced to its type name.

Encode the remaining string, boolean, number, buffer and array valued
options, including `sigalgs`, with `getTlsOptionKey()`, which prefixes
the type and the length, like the options that were already encoded.

Assisted-By: OpenAI GPT-5.6 Sol <openai/gpt-5.6-sol>
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
PR-URL: https://github.com/nodejs/node/pull/67641
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-23 12:34:28 +01:00
Jiawen Geng 7363c8efe1 sqlite: skip query trace while an exception is pending
Database::TraceCallback published sqlite.db.query from SQLite's
profile callback without checking for a pending JavaScript exception.
SQLite runs that callback from sqlite3_step() when a statement fails
and from sqlite3_reset(), so a throwing SQL function or an
out-of-range integer conversion called subscriber JS while an
exception was already set. Debug builds abort in V8's Invoke, and
release builds drop the original error or replace it with an empty
ERR_SQLITE_ERROR.

Return before publishing when the isolate has a pending exception or
JavaScript cannot be entered.

Assisted-by: Cursor Grok 4.7
Signed-off-by: gengjiawen <technicalcute@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67538
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-23 12:34:28 +01:00
Jiawen Geng b9238331b0 sqlite: finalize statements prepared during close
Database::FinalizeStatements() range-iterates statements_ and then
clears the set. Finalizing a statement with an open virtual-table
cursor runs the generator's finally block, which can prepare a new
statement and insert it into the set being iterated. That statement
is never finalized, so it keeps running after close() releases the
connection, and run() then dereferences a null connection.

Erase each statement before finalizing it and continue until the set
is empty, so statements created from that JavaScript are finalized
before the connection is released.

Assisted-by: Cursor Grok 4.7
Signed-off-by: gengjiawen <technicalcute@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67539
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-23 12:34:28 +01:00
Antoine du Hamel d8fc737bfc tools: avoid early exit in release proposal linter
The current script exits at the first error, instead of listing all the
errors to fix.

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67666
Reviewed-By: Ruy Adorno <ruy@vlt.sh>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-23 12:34:28 +01:00
Livia Medeiros eeea6e46c0 lib: replace SafePromiseAll with SafePromiseAllReturn*
`SafePromiseAllReturnArrayLike` and `SafePromiseReturnVoid` are
safer, faster alternatives to `SafePromiseAll`. The latter should
be used only when we expose returned value directly to userspace.

Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67602
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-23 12:34:28 +01:00
James M Snell 689049e37b stream: swap the order of stream/iter result fields
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66504
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-11-23 12:34:28 +01:00