fix(core): validate native file cache size before applying it#33683
Merged
AgentEnder merged 3 commits intomasterfrom Jan 9, 2026
Merged
fix(core): validate native file cache size before applying it#33683AgentEnder merged 3 commits intomasterfrom
AgentEnder merged 3 commits intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 5779b5f
☁️ Nx Cloud last updated this comment at |
cb21cc6 to
4076afb
Compare
FrozenPandaz
approved these changes
Jan 8, 2026
packages/nx/src/native/index.js
Outdated
Comment on lines
+133
to
+135
| if (attempt < maxRetries) { | ||
| // Will retry | ||
| continue; |
packages/nx/src/native/index.js
Outdated
| // Then rename to the final location | ||
| renameSync(tmpTmpFile, tmpFile); | ||
| // Retry copying up to 3 times, validating after each copy | ||
| const maxRetries = 3; |
Collaborator
There was a problem hiding this comment.
move this to the module level
- Validate file size after copying to detect corruption - Retry up to 3 times if validation fails - Fall back to loading from original location if all retries fail - Clean up malformed temp files between retries 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4076afb to
e0c30a3
Compare
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
FrozenPandaz
pushed a commit
that referenced
this pull request
Jan 14, 2026
## Current Behavior We dont validate the size of the native file cache after copying it, which sometimes fails and corrupts the data. This failure results in a different size, so we can detect it. In certain situations, the corruption causes node to hang instead of throw. ## Expected Behavior We detect the corruption ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #30653 Fixes #31300 (cherry picked from commit 42a8a44)
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current Behavior
We dont validate the size of the native file cache after copying it, which sometimes fails and corrupts the data. This failure results in a different size, so we can detect it. In certain situations, the corruption causes node to hang instead of throw.
Expected Behavior
We detect the corruption
Related Issue(s)
Fixes #30653
Fixes #31300