Bug: dsh plugin remove can leave a stale dsh.profile.bundles entry that permanently breaks the profile #913
MicroHEROX
started this conversation in
General
Replies: 1 comment
|
已定位根因:** |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh plugin --profile <X> remove <bundle>intermittently leaves a stale entry indsh.profile.bundlesin the profile package.json. The profile then fails to boot withcannot resolve profile bundle, and neitherdsh plugin installnor any laterdsh plugininvocation can repair it — the only recovery is manually editing the manifest.Environment
github:owner/repospec) — failure observed once; 4/4 controlled reruns of the same remove flow passed, so it is non-deterministicObserved sequence
dsh plugin --profile X add github:owner/repo— bundle registers and works.dsh plugin --profile X remove <bundle>:dependenciesin package.json (manifest written),dsh.profile.bundleskeeps"<bundle>"(reconcile did not run or did not splice).dsh plugin --profile X installanddsh plugin --profile X lsdo not remove the stale entry (verified).dsh.profile.bundlesrestores the profile.Related observation: on a brand-new profile, the first
dsh plugin addsometimes fails to populatedsh.profile.bundles(the row is missing from--dump-configuntil a secondaddis run) — likely the same class of transient reconcile skip.Root-cause hypothesis
In
apps/cli/src/plugin.ts,reconcilePluginsruns onlyif (exitCode === 0). If pnpm exits non-zero after having already written the manifest (this machine showed repeated transientHEAD https://github.com/... ETIMEDOUTfailures during git-hosted pnpm operations), reconcile is skipped while the manifest is already in the removed state.The stale entry is then permanent: on every later invocation,
wasDependency = beforeDeps.has(packageName) || dependencySet.has(packageName)is false (the dependency is gone from both the pre- and post-manifest), so the removal branch never fires, and the entry is treated as user-owned.Suggested fixes (any would work)
beforeDeps: an entry indsh.profile.bundlesthat is neither a template bundle nor present independencies(nor resolvable) should be removed or warned about.Impact
Any bundle type (verified independent of the bundle: a link:-installed bundle removed cleanly; the failure was observed with a github-hosted bundle). Affected profiles are unbootable until the user hand-edits package.json — a poor first-time experience for
dsh pluginusers.All reactions