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

address review: clarify cache naming docs, seed same-version entry in…

7d671da
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 12, 2026 in 20m 8s

Code review found 2 important issues

Found 1 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 2
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/install/PackageManager/PackageManagerDirectories.rs:915-917 path_for_resolution also fails for offline-resolved packages (fix scope for the resolve_from_disk_cache comment)

Annotations

Check failure on line 917 in src/install/PackageManager/PackageManagerDirectories.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

path_for_resolution also fails for offline-resolved packages (fix scope for the resolve_from_disk_cache comment)

Addendum to the comment on PackageManagerResolution.rs:211: fixing only `resolve_from_disk_cache` is insufficient. When it succeeds via `folder_resolver::get_or_put(CacheFolder(..))`, `CacheFolderResolver::resolve` never sets `meta.integrity`, so this PR-added read of `items_meta()[package_id].integrity` here yields `Tag::UNKNOWN` and the `readlinkat` at `<name>/<version>@@@1` (no `_integrity=` suffix) still ENOENTs — resolver.rs:3124 then sees `PreinstallState::Unknown` and falls through to `Ma