Weekly GitHub Report for Node - 2024-12-16 12:00:15
Weekly GitHub Report for Node
Thank you for subscribing to our weekly newsletter! Each week, we deliver a comprehensive summary of your GitHub project's latest activity right to your inbox, including an overview of your project's issues, pull requests, contributors, and commit activity.
Table of Contents
I. News
1.1 Recent Version Releases:
The current version of this repository is v23.4.0
1.2 Other Noteworthy Updates:
II. Issues
2.1 Top 5 Active Issues:
We consider active issues to be issues that that have been commented on most frequently within the last week.
-
Minimum waiting time for PRs with recently pushed commits: This issue addresses the concern that the current guidelines for pull request (PR) waiting times on the Node.js project are calculated from the PR creation date rather than the date of the last pushed commit, which can lead to PRs being merged immediately after significant changes if they were initially opened more than seven days ago. The issue proposes several solutions, including making the waiting time strict from the last push, a semi-strict approach, or simply adding a guideline to wait if non-trivial changes are made, with a preference for a documentation-only change to avoid slowing down trivial fixups.
- The comments reflect a general consensus to keep the current system, trusting collaborators to use their judgment for re-reviews when substantial changes occur. Some suggest that the process could be less strict, allowing minor changes without re-approval, while others emphasize the importance of responsibility and judgment in the process. There is a discussion about the role of the commit queue and the need for explicit guidelines to ensure that all collaborators have the opportunity to review significant changes. Overall, the comments highlight a balance between maintaining efficiency and ensuring thorough review processes.
- Number of comments this week: None
-
Test concurrency causes the Test Runner to report a wrong isTTY value: This issue highlights a problem with the Node.js test runner where using the
child_process
for test parallelization causesprocess.stdout.isTTY
to returnundefined
instead oftrue
, which is inconsistent with the expected behavior when running tests with the--test
flag. The inconsistency is problematic as it leaks implementation details and contradicts the Principle of Least Astonishment (POLA), leading to confusion for developers relying on the API's expected behavior.- The comments discuss the technical reasons behind the
isTTY
value beingundefined
when using the--test
flag, explaining that the process runs as a child of the test harness, which affects the standard streams. There is a consensus that this behavior is a leaky abstraction, and the expected behavior should be consistent regardless of the test flag used. The conversation also touches on the need for documentation or a fix to address this inconsistency, as it impacts how errors are logged and perceived by developers. - Number of comments this week: None
- The comments discuss the technical reasons behind the
-
Writable.write(buf, sourceOffset, sourceLength)
: This issue proposes adding a new API method,Writable.write(sourceBuf, sourceOffset, sourceLength)
, to theWritable
class in order to improve performance by avoiding the slow allocation ofBuffer
when using thesubarray
method. The author is uncertain about the potential impact on existing code and seeks input on whether this new method would be beneficial or if it might introduce complications.- The comments discuss the potential complexity and performance implications of adding the proposed API, with some suggesting exploring it as a separate open-source module. There is skepticism about whether the performance gains justify the changes, and benchmarks are shared to illustrate the performance difference. Some suggest investigating improvements in the V8 engine, but it is noted that changes there may not be feasible.
- Number of comments this week: None
-
.pipeTo(Writable.toWeb(process.stdout))
returns a never-settling Promise: This issue describes a problem with the Node.jsstream
module where using.pipeTo(Writable.toWeb(process.stdout))
results in a promise that never settles, causing a warning about an unsettled top-level await. The problem is consistently reproducible across multiple versions of Node.js, and the expected behavior is for the promise to resolve without any warnings.- The comments discuss attempts to simplify the code to isolate the issue, revealing that the promise never resolves, which is the core problem rather than the warning itself. Initial debugging suggests that the issue might be related to how the
closed
property is handled in the code, and further testing indicates that the problem started occurring in Node.js version 22.0.0. It is speculated that the issue could be related to a V8 update or another major change in version 22.x, and a commit related to detecting unsettled top-level awaits is identified as a potential factor. - Number of comments this week: None
- The comments discuss attempts to simplify the code to isolate the issue, revealing that the promise never resolves, which is the core problem rather than the warning itself. Initial debugging suggests that the issue might be related to how the
-
readFile will not read files larger than 2 GiB even if buffers can be larger: This issue addresses a limitation in the Node.js
readFile
function, which cannot read files larger than 2 GiB despite the buffer size being capable of handling larger data. The problem arises because the function throws aRangeError
when attempting to read files exceeding this size, which contradicts the expectation thatreadFile
should support files as large as the maximum buffer size.- The comments discuss whether the issue is purely documentation-related or if there is a need to adjust the underlying I/O limit. Suggestions include updating the error message to guide users towards using
fs.createReadStream()
for large files, as it handles data in smaller chunks, thus avoiding memory issues. There is also a proposal to improve the error message to make users aware of the 2 GiB limit and suggest alternatives for handling large files. - Number of comments this week: None
- The comments discuss whether the issue is purely documentation-related or if there is a need to adjust the underlying I/O limit. Suggestions include updating the error message to guide users towards using
2.2 Top 5 Stale Issues:
We consider stale issues to be issues that has had no activity within the last 30 days. The team should work together to get these issues resolved and closed as soon as possible.
As of our latest update, there are no stale issues for the project this week.
2.3 Open Issues
This section lists, groups, and then summarizes issues that were created within the last week in the repository.
Issues Opened This Week: 12
Summarized Issues:
- TLS ServerName Issue in HTTP2 Client: The HTTP2 client in Node.js is incorrectly setting the TLS ServerName to an IP address, which is not compliant with RFC 6066. This results in a deprecation warning and necessitates a code fix to prevent this behavior. The challenge is to implement this fix without causing regression in related functionalities.
- SQLite Module Improvements: There are proposals to organize
SQLITE_CHANGESET_*
constants under aconstants
namespace within the experimentalnode:sqlite
module to prevent module scope pollution. Additionally, there's a need to address a problem with the conflict handling mechanism in the SQLite session extension. The current implementation incorrectly allows theSQLITE_CHANGESET_REPLACE
resolution code in invalid situations, leading to function aborts and errors.
- Segmentation Faults in Node.js: Node.js version 20.15.0 is experiencing segmentation faults during the shutdown process of a large cluster of Node processes on x64 architecture. This issue is related to the ResetCreateHistogramFunction and results in core dumps approximately 10 times per restart. The problem does not occur on aarch64 architecture or with older Node versions.
- Heap Snapshot and Diagnostic Directory: There is a proposal to modify the
--heap-snapshot-on-oom
parameter to respect the--diagnostic-dir
parameter. This change would allow users to specify a directory for heap dumps, such as an S3 mount, to streamline the process and avoid manual copying. Additionally, there is an inquiry about the possibility of renaming heap dumps via a parameter.
- File Copy Error on CIFS Share: The
fs.promises.copyFile
andfs.copyFileSync
functions in Node.js versions 22.12 and 23.4 are failing with an "EPERM: operation not permitted" error. This occurs when attempting to copy files from a local disk to a mounted CIFS share on an Alpine Linux container. The issue is suspected to be related to a recentlibuv
update.
- Documentation and Linting Enhancements: There is a need to add checks for documentation placeholders to the lint-release-proposal workflow in the Node.js project. This enhancement aims to prevent issues from arising later when the release build is triggered on Jenkins. The goal is to ensure a smoother release process by catching potential documentation errors early.
- Enhancements to Node.js Glob Function: A proposal has been made to enhance the
glob
function in the Node.js project. The enhancement would allow the function to accept a glob pattern for theexclude
option, similar to the functionality available in Deno. This change aims to improve the utility of the function and align it with user expectations.
- Node.js Assertion Method Bug: There is a bug in the Node.js project where the
assert.partialDeepStrictEqual
method fails to throw an error when comparing arrays containing0
and-0
. This behavior is inconsistent with theassert.deepStrictEqual
method, which behaves as expected. The issue highlights the need for consistency in assertion methods.
- Segmentation Fault in CI Pipeline: A segmentation fault and core dump occur intermittently during the 'yarn lage build bundle' step in a pipeline on a Linux-based CI agent. This issue arose after upgrading from Node.js 18 to Node.js 20, with no specific conditions for reproduction. Despite attempts at troubleshooting, including system monitoring and core dump analysis, the issue persists.
- Module Hooks in Node.js: The Node.js project is tracking the progress and implementation of
module.registerHooks()
. This includes tasks such as developing evaluation and link hooks for CommonJS and ECMAScript modules, integratingSymbol.dispose
, and reordering documentation. Discussions are ongoing about changing the evaluation hook approach and collaborating with V8 for ESM support.
- Feature Proposal for Net Module Blocklist: A feature proposal suggests saving the blocklist to disk in the Node.js net module. This would avoid the need for manual re-blocking by introducing a parameter in the class for storing the rules. The proposal aims to enhance the usability and efficiency of the net module's blocklist functionality.
2.4 Closed Issues
This section lists, groups, and then summarizes issues that were closed within the last week in the repository. This section also links the associated pull requests if applicable.
Issues Closed This Week: 22
Summarized Issues:
- Module Loader Hooks API Proposal: This issue proposes the creation of a universal module loader hooks API to replace the current practice of monkey-patching the CommonJS loader in Node.js. The goal is to simplify the module loading process and improve maintainability. It also aims to provide a seamless migration path for both CJS and ESM loading customizations while addressing limitations of the existing
module.register()
API and challenges posed by off-thread hooks.
- Memory Leak in File System Watches on Windows: A memory leak problem is identified in Node.js when using file system watches on Windows, where memory usage continues to rise despite closing the watches. The leak is attributed to a
short_path
variable in thelibuv
library that is not being freed. This issue does not occur on Linux systems.
- SQLite Extension and Function Support: Node.js is considering adding support for SQLite load extensions and the
sqlite3_create_function
to enhance compatibility with existing SQLite libraries. The proposal includes adb.loadExtension(path)
method and aims to enable customized queries like regex or NLP search. This would improve the Node.js ecosystem's integration with SQLite.
- ExperimentalWarning Suppression Proposal: This issue discusses the problem of receiving an "ExperimentalWarning" when using the new default
require(esm)
setting in Node.js version 23.0.0. A feature is proposed to globally suppress this warning to avoid output pollution during automated processes. This is particularly relevant when installing global npm packages.
- Misleading Console Output in Hardened JavaScript: A misleading console/inspect output issue is identified in Hardened JavaScript, where functions are incorrectly displayed as plain objects. This is due to the modification of
Function.prototype.constructor
. A fix is proposed to prioritize the "is function" check over the "constructor is Object" check to ensure functions are correctly identified.
- GitHub Actions and Visual Studio Compilation Failures: Node.js needs to disable certain GitHub Actions for Windows due to persistent compilation failures caused by Visual Studio version 17.12. The plan is to mark this version as unsupported. A related issue has already been reported to Microsoft.
- Debugger Breakpoint Binding Issues: A bug in Node.js v23.2.0 causes breakpoints set in the VS Code debugger to not bind, allowing the program to run without stopping at the breakpoints. This issue does not occur in Node.js v23.1.0 and is linked to changes affecting the enumeration of named pipes on Windows. The problem is consistently reproducible and resolved by reverting to Node.js version 23.1.0.
- Regression in Named Pipe Enumeration on Windows: Node.js version 23.2 on Windows has a regression where the
fs
module lost the ability to enumerate named pipes. This is due to a change in how paths are handled, resulting in an error when attempting to read the\\\\.\\pipe
directory. This affects applications like js-debug's debugger and lacks a straightforward workaround.
- Persistent "FATAL ERROR" in Node.js on Darwin: A persistent "FATAL ERROR: v8::FromJust Maybe value is Nothing" error occurs in Node.js version 20.18.0 on a Darwin platform. It is consistently reproduced when running a specific branch of a GitHub repository and appears to be related to a race condition in the worker threads. The issue does not reproduce in Node.js version 22 and above.
- Bug in
assert.partialDeepStrictEqual
Function: Theassert.partialDeepStrictEqual
function in Node.js fails to correctly compareInt16Arrays
,ArrayBuffers
, andSharedArrayBuffers
. This results in test failures that should not occur according to the expected behavior. The issue highlights a need for a fix to ensure accurate comparisons.
- Build Failure in Node.js Addons Sample Code: The 'hello world' sample code for Addons, documented on the Node.js website, fails to build using
node-gyp
on a Darwin platform. The error is due to a mismatch in theSet
function call in thehello.cc
file. This issue requires a correction to align with the expected build process.
- Flaky Test in Node.js Project: A flaky test,
parallel/test-abortsignal-drop-settled-signals
, fails due to an assertion error when checking if settled dependent signals are correctly dropped. The error indicates that the expected value of 0 does not match the actual value of 2. A contributor has acknowledged that recent changes might have caused this issue and is working on a fix.
- OpenSSL Breaking Changes Affecting Prisma Client: OpenSSL breaking changes affect the Prisma client when running a migration against a PostgreSQL database with the latest Docker images. This results in a failure to detect the correct OpenSSL version and causes SSL connection issues. The issue highlights the need for compatibility adjustments.
- Change in DNS Result Order Behavior: Node.js version 22.12.0 exhibits a change in behavior where the
--dns-result-order=ipv4first
argument no longer functions as expected. Applications bind to the IPv6 address instead of the IPv4 address, despite the argument being present. This change affects network configuration and requires attention.
- Unexpected Memory Requirements for Heap Snapshots: Generating heap snapshots in a Node.js application running in a Docker container requires unexpectedly large memory. The user observes that significantly more memory is needed than anticipated based on the common guideline of "2xMemory" for heap snapshot generation. This is particularly evident when dealing with large arrays.
- Misunderstanding of
dropRequest
Event in HTTP Server: There is a misunderstanding of thedropRequest
event in the Node.js HTTP server. The user expected the event to trigger and return a 503 status code when requests exceeded theserver.maxRequestsPerSocket
threshold. Instead, all requests were processed with a 200 status code due to the client using a new socket for additional requests.
- Regression in
TextDecoder
Behavior: Node.js version 23.4.0 has a regression where theTextDecoder
for encodings such as 'ascii' and 'windows-1252' unexpectedly returns a buffer instead of a string. This was the behavior in the previous version 23.3.0. The issue is being actively investigated for a fix in an upcoming release.
- Crypto Operation Failure in Development Environments: Reloading in development environments like Bun or Metro causes the
cipher.update
function in a crypto operation to fail with an "Error: Value is undefined, expected an Object." This occurs after the first successful run of the app, suggesting a potential issue with the bundler or polyfill package rather than Node.js itself.
- Crash in
fileHandle.readableWebStream
Method: ThefileHandle.readableWebStream
method in Node.js crashes when processing large file inputs over 300MB on Microsoft Windows NT 10.0.26100.0 x64. Instead of handling them smoothly as expected, the method fails, indicating a need for improved handling of large files.