Skip to content

fix(client): register the browser bundle under the package name - #24

Open
fishdivinity wants to merge 1 commit into
PerryLink:mainfrom
fishdivinity:fix/client-bundle-package-id
Open

fishdivinity wants to merge 1 commit into
PerryLink:mainfrom
fishdivinity:fix/client-bundle-package-id

Conversation

@fishdivinity

Copy link
Copy Markdown

Checklist

  • The full gate is green: pnpm run typecheck && pnpm test && pnpm run build && pnpm run check:readmes
  • Tests were added or updated for the change
  • CHANGELOG.md has an entry under ## [Unreleased]
  • All five READMEs stay in sync where the change touches docs — no README change needed
  • A related issue is referenced (Fixes #16)
  • No credentials, tokens, keys, or private paths are included in the diff

Summary

lib/client.js now 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-modules keys client rows by package name. The first load of the batch registered dsh-github, so the row for @perrylink/dsh-github was still missing; the loader fell back to the single-resource URL, executed the same bundle a second time, and aborted web boot with duplicate factory registration. DSH Desktop fatal recovery then reset dsh.profile.bundles and backed up cordis.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: read package.json.name and 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 skipped
  • pnpm 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__.load id 从写死的 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。

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 0.7.24 client wrapper registers "dsh-github" instead of "@perrylink/dsh-github" — boot aborts and DSH resets the profile

1 participant