install: key npm cache entries by their integrity, derive URL-based cache names with SHA-256 - #37756
Closed
Jarred-Sumner wants to merge 10 commits into
Closed
install: key npm cache entries by their integrity, derive URL-based cache names with SHA-256#37756Jarred-Sumner wants to merge 10 commits into
Jarred-Sumner wants to merge 10 commits into
Claude / Claude Code Review
completed
Aug 12, 2026 in 18m 46s
Code review found 3 potential issues
Found 1 candidates, confirmed 3. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 3 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/install/PackageManager/PackageManagerDirectories.rs:390-415 |
Persistently empty .id file is never repaired |
Annotations
Check warning on line 415 in src/install/PackageManager/PackageManagerDirectories.rs
claude / Claude Code Review
Persistently empty .id file is never repaired
The `Ok(0) => continue` arm never unlinks or falls through to the `O_CREAT|O_EXCL` block, so a persistently 0-byte `.id` (process killed between the exclusive create and `write_all`) is never repaired — every later process reads `Ok(0)` three times and falls through to a per-run `rand_bytes` key, so fingerprinted cache entries never hit and orphans accumulate. On the final iteration treat `Ok(0)` like the `Ok(_)` truncated case (unlink and fall through), or write to a temp name and `renameat` so
Loading