Hosted pnpm rollback drops the upstream `tarball:` URL from locks written with `lockfileIncludeTarballUrl`, so the restore isn't byte-exact
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
Direzione di ricerca
Start at crates/socket-patch-core/src/formats/pnpm/grammar.rs:203, especially Resolution::restore, and review the pnpm compatibility property in docs/testing/pnpm-compatibility.md. Reproduce the hosted pin and rollback with lockfileIncludeTarballUrl enabled, then verify rollback restores the tarball URL when it was present and preserves its absence otherwise, with byte-exact lockfile output.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[agent] Found by the scheduled pnpm bug-hunt routine (ledger #303).
Summary
With pnpm's lockfile-include-tarball-url=true (.npmrc) or lockfileIncludeTarballUrl: true (pnpm-workspace.yaml), pnpm records every resolution as {integrity: …, tarball: https://registry.npmjs.org/<name>/-/<name>-<ver>.tgz}. The hosted pin itself works: integrity and tarball are both replaced, and a fresh frozen install is patched. But rollback restores only {integrity: …}, so the lock no longer matches what pnpm wrote and the project setting asks for. pnpm doesn't re-add the field: a plain pnpm install afterwards leaves the lock unchanged ("up to date"), so the tarball URL stays lost until someone re-resolves.
Impact
Low. Installs still work, because pnpm derives the URL from the configured registry. But rollback isn't byte-exact, which docs/testing/pnpm-compatibility.md lists as a covered property. It also gives a spurious lock diff in projects that rely on recorded tarball URLs (mirrors, air-gapped tooling, audits).
Repro (Linux; local patch-API mock with SOCKET_PATCH_SERVER_URL / SOCKET_NPM_REGISTRY pointed at it)
mkdir app && cd app
echo '{"name":"app","version":"1.0.0","dependencies":{"is-number":"7.0.0"}}' > package.json
echo lockfile-include-tarball-url=true > .npmrc # pnpm 12: lockfileIncludeTarballUrl: true in pnpm-workspace.yaml
pnpm install && cp pnpm-lock.yaml before.yaml
socket-patch scan --mode hosted --json --yes … # success, redirected 1
socket-patch rollback --json --yes # success
diff before.yaml pnpm-lock.yaml
# - resolution: {integrity: sha512-41Cifkg6…, tarball: https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz}
# + resolution: {integrity: sha512-41Cifkg6…}
pnpm install && diff before.yaml pnpm-lock.yaml # still differs; pnpm doesn't re-add it
Expected vs actual
- Expected: CLI_CONTRACT ("Unwinding hosted state", npm family) says rollback restores the "resolution + integrity … from the npm registry's version document", and that document carries
dist.tarball. When the pre-pin entry had atarball:field (or the project setslockfileIncludeTarballUrl), rollback should write the registrydist.tarballback. When it didn't, rollback should keep omitting it. - Actual:
tarballis always omitted.
Matrix (Linux, each run twice)
| pnpm | hosted pin + fresh frozen install | rollback byte-exact |
|---|---|---|
9.15.9 (.npmrc) |
pass | fail |
10.34.5 (.npmrc) |
pass | not run |
| 12.8.1 (workspace setting) | pass | fail |
Suspect code
crates/socket-patch-core/src/formats/pnpm/grammar.rs:203 – Resolution::restore drops tarball unconditionally ("pnpm omits tarball for a package the configured registry serves"), which isn't true under this setting.
Tested on main 61cfb9b (CLI 4.0.0).
- Lingua principale
- Rust
- Stelle
- 8
- Fork
- 0
- Merge medio
- 1g 1h
- PR unite (30g)
- 211
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SocketDev/socket-patch
-
arch-audit refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
SocketDev/socket-patch#1011 ·
I maintainer di solito rispondono entro 1 giorno
-
agent:triaged arch-audit bug priority:p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
SocketDev/socket-patch#982 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Hosted yarn classic pins give no berry-migration warning, so a yarn 2+ install silently drops them (vendored warns about the same trap)Forse già presa @mikolalysenko l’ha presa 1 giorno fa. Apertaagent:claimed agent:triaged bug bughunt pm:yarn-classic priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
SocketDev/socket-patch#907 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
agent:triaged bug bughunt pm:bundler priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
SocketDev/socket-patch#896 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
SocketDev/socket-patch#783 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SocketDev/socket-patch
Issue simili
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
fastrevmd-lab/rustmistmcp#161 ·
-
bug user-priority/P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
opencode: an unanswered --version probe launches opencode 2 without per-session service isolationAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
security-advisory
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
MinBZK/regelrecht#1686 ·
I maintainer di solito rispondono entro 1 giorno
-
L: github:actions L: php:composer
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
dependabot/dependabot-core#16493 ·
I maintainer di solito rispondono entro 1 giorno