Repository navigation
Typed plugin installs can silently install an older version than the dialog showed (registry fallback + stale mirror) #14047
Replies: 2 comments
|
Cross-checking for duplicates before the PR: this is the same family as #12209 (update list ignores dist-tags.latest, offers a semver-higher older line) and #13236 (catalog installs resolve npm |
|
A ready-to-take fix is on my fork:
(I could not open a PR directly: this repository rejects |
Uh oh!
There was an error while loading. Please reload this page.
Typed plugin installs can silently install an older version than the one the dialog showed
Summary
Installing a plugin from the Web UI (Plugins → Add plugin) by typing a bare npm package name can end up installing an older version than the version the dialog showed before the install, when a fallback registry serves a stale packument snapshot. The user then has to update manually.
Reported against
@deepseek-ai/dsh0.2.2-rc.4, reproducing with the third-party bundledsh-marker(published 0.1.3 → 0.1.4 → 1.0.0 within two days; 1.0.0 was ~3 hours old when this happened).What happens
For a typed registry spec, the dialog and the installer resolve the version independently:
inspectshows the version frompnpm view <name>— thelatestof the first registry that answers (say npmjs,1.0.0). The dialog says "will install 1.0.0".installBundlethen runspnpm add <name>without pinning that version, solatestis re-resolved at install time.fallbackRegistriesdefaults to["https://registry.npmmirror.com/"].latestis still0.1.3, sopnpm addsucceeds with 0.1.3 and saves^0.1.3.The result: the dialog promised 1.0.0, the profile got 0.1.3, and nothing failed. The saved non-exact range then keeps the old version until a manual update (the update path is unaffected: it pins
name@versionwith--save-exactand anexpectedcheck).Reproduction
Local proof with two stub registries (A = fresh packument
latest=1.0.0but tarball downloads cut; B = whole packument frozen atlatest=0.1.3, tarballs served):Pinning the spec changes the outcome to either the promised version or an honest failure:
Why a stale mirror is realistic
npmmirror syncs packuments on demand; a low-traffic package that nobody requested since an older release keeps serving that older snapshot (whole-packument cache,
dist-tagsincluded). npmjs ↔ mirror disagreement during the sync window is exactly when this bites — and it bit a freshly published 1.0.0.Suggested fix
The catalog path already does the right thing (
marketInstallTargetreturnsname@version,saveExact: true). The typed path should do the same: when the inspection named a name and version, installname@versionwithsaveExact: trueand passexpected: { name, version }so an unexpected version is undone and reported instead of kept.PR follows.
All reactions