Skip to content

Download and install Lyra updates automatically. - #103

Merged
angelrdavila merged 1 commit into
mainfrom
feat/auto-updates
Dec 2, 2026
Merged

angelrdavila merged 1 commit into
mainfrom
feat/auto-updates

Conversation

@angelrdavila

Copy link
Copy Markdown
Member

Summary

Lyra already checked GitHub's releases/latest every 4 hours, but only showed a notice. You had to click to download and then restart. This PR makes updating automatic and lets you control it:

  • New updates setting (auto | notify | off, default auto):
    • auto downloads a new release in the background (electron-updater autoDownload) and installs it on the next quit or restart (autoInstallOnAppQuit). It never installs in the middle of a session.
    • notify keeps the old ask-first behaviour.
    • off stops the timer, so Lyra only checks when you ask.
  • Settings → About → Updates: pick the mode, see the status (up to date, checking, available, downloading, ready, failed) and use one action button: Check now, Download, Restart to update or Retry.
  • New updater:check IPC channel (types, preload and handler) for the manual check. UpdateStatus gains unavailable, checking and latest.
  • Activity, per docs/STATES.md: a download Lyra starts on its own stays hidden until it's ready, then shows a "Restart to update" row. A check or download you start shows its progress and any failure. If a background download fails, Lyra falls back quietly to "available" and tries again at the next check.
  • macOS: unsigned Mac builds still can't replace themselves, so they never auto-download and still open the releases page. Lyra now reads the signature once, asynchronously, instead of running spawnSync on every action.
  • The pure decision logic lives in updatePolicy.ts and has unit tests.

No changes to the release workflow: it already publishes latest*.yml and the blockmaps that electron-updater reads.

Checks

  • pnpm typecheck (both tsconfigs), eslint, config:check and vitest: 90 files, 670 tests passed. pnpm isn't on the dev machine's PATH, so I ran the same tools directly.
  • Changeset added (minor)
  • pnpm smoke:ui: ui-smoke: ok. The new case checks that a test run reports unavailable, the default is auto, notify saves and an unknown mode is refused.
  • Looked at the Updates section with pnpm screenshot --review in light and dark mode.
  • Not verified end to end in a packaged build: a real background download and install-on-restart needs a release newer than the installed version.
  • Stays local-first. The only network call is the existing one to this repo's GitHub releases, and it can now be turned off.

- Add an `updates` setting (auto, notify, off; default auto): auto downloads a new release in the background and installs it on the next restart.
- Add a manual check (`updater:check`) and an Updates section in Settings → About with the status and Check now, Download or Restart to update.
- Keep background downloads out of Activity until they're ready; read the Mac signature once, asynchronously.
- Unit-test the update policy and the setting's parsing; add a UI smoke case.
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lyra Ready Ready Preview Dec 1, 2026 3:29am UTC

@angelrdavila
angelrdavila merged commit 7d23da8 into main Dec 2, 2026
13 checks passed
@angelrdavila
angelrdavila deleted the feat/auto-updates branch December 2, 2026 17:52
@angelrdavila angelrdavila mentioned this pull request Dec 2, 2026
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.

1 participant