Repository navigation
fix(desktop-windows): guard packaged startup before auto-update handoff - #13858
Conversation
chore: sync fork main from BasedHardware/omi
Fixes BasedHardware#10849. The in-app "Restart to update" path was installing Windows releases that crashed on launch (Cannot find module 'ms') when electron-builder omitted Sentry's debug/ms chain. Add a final-artifact probe on win-unpacked builds, wire it into CI and release packaging, defer quitAndInstall so NSIS can complete assisted updates, and set runAfterFinish on the NSIS target. Failure-Class: FC-runtime-image-boundary Verified: node node_modules/vitest/vitest.mjs run (from desktop/windows) scripts/verify-packaged-main-runtime.test.mjs scripts/build-scripts-publish.test.mjs src/main/updater.test.ts — 20 passed Co-authored-by: Apoorv Darshan <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 11 files
You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Resolve ms from debug's module graph instead of Sentry's require root, and fail when ms/main/Sentry paths fall outside OMI_PACKAGED_APP_ROOT. Addresses cubic P1 on BasedHardware#13858. Verification: verify-packaged-main-runtime.test.mjs (9 passed). Co-authored-by: Apoorv Darshan <[email protected]>
|
Verified end to end against the packaged artifact — this is a well-built guard. Per-file notes below. New guard:
Wiring:
Updater handoff:
Two things for a maintainer:
Leaving for human maintainer review given the duplicate-PR decision and the release-pipeline surface. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…mage-boundary (#13869) Registry-only scope_hints update so failure-class prepare surfaces FC-runtime-image-boundary for Windows packaging/probe work. Addresses cubic P3 on #13858. Co-authored-by: Cursor Agent <[email protected]>
aryanorastar
left a comment
There was a problem hiding this comment.
Verified on 1ff95cc.
Packaged Windows startup is probed after electron-builder (verify:packaged-main) before the auto-update feed, and runAfterFinish is on for assisted updates. Tests pin the verify step after both build:win scripts and the signed-release workflow.
This touches .github/workflows/** (CODEOWNERS @Git-on-my-level). My approve is not a fake David CODEOWNERS review. I am not merging.
Fixes #10849
Summary
Reporter feedback on #10849 clarified the failure mode: Settings → About → Restart to update closes Omi and runs the NSIS updater, but the installed build then crashes on launch with
Cannot find module 'ms'(same packaging boundary as #10738). That looks like an uninstall-without-reinstall from the user’s perspective.Root cause on affected releases: electron-builder’s dependency collection shipped Sentry’s
debugchain without hoistedmsin the final Windows artifact.mainalready pins electron-builder ~26.15.x, which includes the transitive dep; this PR adds a final-artifact probe so broken installers cannot reach the auto-update feed again, plus two updater handoff hardening tweaks.Changes
verify-packaged-main-runtime.mjs— Afterwin-unpackedis built, run the packaged Electron binary withELECTRON_RUN_AS_NODEand resolve@sentry/electron/main→debug→msthrough the same ASAR loader the app uses at startup.build:winand newbuild:win:unpackrun the probe; Windows CI usesbuild:win:unpack; signed release path runspnpm verify:packaged-mainafter electron-builder.quitAndInstallwithsetImmediateso Electron finishes quitting before NSISupdate.exeruns (avoids assisted-installer getting stuck after uninstall). Set explicitrunAfterFinish: trueon the NSIS target.Product invariants affected
none
Failure class
Failure-Class: FC-runtime-image-boundary
Verification
From
desktop/windows:20 tests passed.
Full Windows
build:win:unpack+ live probe requires a Windows runner (Desktop Windows CI).September 30 metadata verification
Validated the current PR metadata locally with
scripts/pr-preflight --metadata-only; refreshing this description retriggers the previously cancelled metadata preflight. The packaging/runtime checks on the code head were already passing. The Windows scope-hint suggestion is non-blocking and belongs in a separate registry-only lifecycle PR under the failure-class protocol.