fix(storage): resolve Node compatibility crashes, security vulnerability, and stream hangs#8622
Open
thiyaguk09 wants to merge 8 commits into
Open
fix(storage): resolve Node compatibility crashes, security vulnerability, and stream hangs#8622thiyaguk09 wants to merge 8 commits into
thiyaguk09 wants to merge 8 commits into
Conversation
…eam error callbacks in File.ts
…ith cleanup on process exit
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a preload script to safely resolve yargs/yargs dependencies, updates yargs packages, handles destroyed write streams in file.ts, and refactors the test suite to safely copy fs properties. The review feedback suggests two key improvements: first, simplifying the yargs preload script by directly resolving to the CommonJS build file to eliminate disk I/O and potential cleanup issues; second, using Object.getOwnPropertyDescriptors when copying fs properties in tests to completely avoid triggering deprecated getters and printing warnings.
…ctly instead of using shim files
…prove security and prevent path conflicts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves Node.js version compatibility crashes, fixes a security vulnerability in our build scripts, and prevents stream cleanup tasks from hanging.
Dependency & Node 26 Fixes: Upgraded
yargsto^17.7.2to resolve arequire is not definedcrash on Node 26, while preserving support for Node 18.Secure Yargs Preload Shim: * Fixed a CWE-377 security vulnerability by moving the generated shim file from the global temp directory to the local project folder. Added auto-cleanup on exit and skipped shimming for
.mjsfiles to prevent crashes on Node 22+.Stream Reliability (
src/file.ts): Added a fallback to ensurepipelineCallbackalways executes if a write stream is destroyed early, preventing hanging promises.Test Warning Cleanup (
test/file.ts): UpdatedfakeFsto clone thefsmodule safely without triggering deprecated getter warnings.