Repository navigation
fix(client): register the browser bundle under the package name - #24
fishdivinity wants to merge 1 commit into
Conversation
The wrapper hardcoded id "dsh-github", but DSH 0.2.1 keys client rows by package name (@perrylink/dsh-github). The first load registered the short id; the loader fell back to the single-resource URL, re-executed the bundle, and aborted web boot with duplicate factory registration. DSH Desktop fatal recovery then reset the whole profile. Read package.json.name in scripts/bundle-client.mjs, regenerate lib/client.js, and assert the registration id in verify:artifacts plus a VM-based regression test. Fixes PerryLink#16.
|
Independently verified on a real DSH 0.2.1-rc.2 desktop profile — this is the right fix, and I'd take it as-is. I hit the same failure with
Practical impact: until this lands, every 0.7.24 user has to carry a local One non-blocking nit: |
|
+1 from another affected desktop user — same failure on DSH Desktop 0.2.1-rc.2 with Could this be merged and published as 0.7.25? npm still serves 0.7.24 as |
Checklist
pnpm run typecheck && pnpm test && pnpm run build && pnpm run check:readmesCHANGELOG.mdhas an entry under## [Unreleased]Fixes #16)Summary
lib/client.jsnow registers its browser factory under the package name (@perrylink/dsh-github) instead of the hardcoded short id (dsh-github).Why
DSH 0.2.1-rc.2's
@deepseek-ai/dsh-client-moduleskeys client rows by package name. The first load of the batch registereddsh-github, so the row for@perrylink/dsh-githubwas still missing; the loader fell back to the single-resource URL, executed the same bundle a second time, and aborted web boot withduplicate factory registration. DSH Desktop fatal recovery then resetdsh.profile.bundlesand backed upcordis.patch.yml, disabling every third-party plugin.Fixes #16. This is the remaining id mismatch in the wrapper added for #12/#13; #13 fixed the raw ESM, not the id.
Changes
scripts/bundle-client.mjs: readpackage.json.nameand use it for the loader id; fail loud if the manifest has no name.lib/client.js: regenerated with the package-name id.scripts/verify-artifacts.mjs: execute the shipped bundle with a stub__ModuleLoader__, assert exactly one registration under the package name.test/client-bundle.test.ts: the same contract as a unit regression test.CHANGELOG.md: Unreleased entry.Verification
pnpm run typecheck✅pnpm test✅ 188 passed / 3 skippedpnpm run build✅pnpm run verify:artifacts✅pnpm run verify:self-contained✅pnpm run check:readmes✅pnpm run lint✅ (0 errors; existing warnings only)中文摘要
lib/client.js的__ModuleLoader__.loadid 从写死的dsh-github改为package.json.name(@perrylink/dsh-github)。DSH 0.2.1-rc.2 按包名建 client 行;短名会导致宿主回退到单资源 URL、重复执行同一个 bundle,触发duplicate factory registration,web boot 失败后 DSH Desktop 会重置整个 profile。修复同时加了verify:artifacts校验和 VM 回归测试。Fixes #16。