Skip to content

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
mainfrom
claude/install-cache-entry-identity
Closed

install: key npm cache entries by their integrity, derive URL-based cache names with SHA-256#37756
Jarred-Sumner wants to merge 10 commits into
mainfrom
claude/install-cache-entry-identity

install: create the cache .id owner-readable and use a per-process ke…

89a7a79
Select commit
Loading
Failed to load commit list.
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

See this annotation in the file changed.

@claude 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