feat(updater): auto-update on launch + manual check in Settings#47
Merged
Conversation
Now that release builds are signed + notarised, wire electron-updater
to keep installs current.
Main process:
- New `src/main/updater.ts` initialises electron-updater on app ready
(production only — dev builds skip).
- Silent check 4s after launch; auto-downloads new releases in the
background; native macOS dialog asks the user to restart once a
download completes; `quitAndInstall` on Restart.
- Status broadcast to all renderer windows via `updater:status`
channel so the Settings card stays live.
Renderer:
- Settings → About card gains an "Updates" row showing current state
("Up to date", "Update available (vX)", "Downloading… 30%", etc.)
alongside a "Check now" button that triggers a manual check.
IPC contract:
- `window.api.updater.status()` / `.check()` / `.onStatus(handler)`.
- `UpdaterStatus` union exported from `preload/api.ts` so both sides
share the type.
Also trimmed the CodeQL workflow's `push: branches: [main]` trigger —
every change reaches main via PR, so the push run just duplicated the
PR run. Pull-request + weekly cron + manual dispatch are enough.
7 tasks
aicayzer
added a commit
that referenced
this pull request
May 18, 2026
…er (#66) electron-builder + pnpm has a known dep-walker bug (electron-userland/electron-builder#9654) that drops `ms` from the packaged asar even when node_modules is hoisted flat. Without `ms`, packaged builds crash on launch the moment `electron-updater` loads — the require chain is `electron-updater → builder-util-runtime → debug → ms`. The bug has been latent on main since #47 merged 90s after v0.2.1 was tagged, so no shipped release has exercised it. Workaround: promote `debug` and `ms` from transitives of `electron-updater` to direct dependencies. electron-builder includes direct deps reliably regardless of its pnpm walker behaviour. Also set `nodeLinker: hoisted` + `shamefullyHoist: true` in pnpm-workspace.yaml (pnpm 10+ ignores these in .npmrc). With the explicit deps the hoisted linker isn't strictly required, but it keeps the layout predictable for any other electron-builder traversal. Verified locally: `npx asar list` on the built .app now shows `/node_modules/ms/package.json`, and the installed .app launches without the `Cannot find module 'ms'` exception. Remove these explicit deps when #9654 is fixed upstream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Now that release builds are signed + notarised, wire
electron-updaterso installed apps stay current.Behaviour
autoUpdater.quitAndInstall().Not checked yet/Checking…/Up to date/Update available (vX)/Downloading… 30%/Update downloaded (vX) — restart to install/Couldn't check (msg).Plumbing
src/main/updater.ts— encapsulates the autoUpdater event lifecycle, broadcasts status to all windows.src/main/ipc.ts—updater:status/updater:checkhandlers.src/preload/api.ts— exposeswindow.api.updater.{status,check,onStatus};UpdaterStatusunion exported here so both sides share the type.src/renderer/src/screens/Settings.tsx— AboutCard subscribes to push updates on mount.Other tidy-ups bundled in
.github/workflows/codeql.yml— drop thepush: branches: [main]trigger. Every change hits main via PR, so the push run just duplicated the PR run. PR + weekly cron + manual dispatch are enough.Test plan
pnpm typecheck && pnpm lint && pnpm format:check && pnpm testcleanpnpm exec electron-vite buildsucceeds locally