Skip to content

feat(updates): add in-app auto-updates with restart toast - #312

Draft
kalvinnchau wants to merge 3 commits into
mainfrom
peon/auto-updates
Draft

kalvinnchau wants to merge 3 commits into
mainfrom
peon/auto-updates

Conversation

@kalvinnchau

Copy link
Copy Markdown
Contributor

In-app auto-updates, ported from block/buzz desktop with its copy.

  • src/features/updates/updates.ts is the app-wide update owner. It checks at startup and every 6 hours, skipping while a check, download or install is in progress. Manual checks join an in-flight check. When an update is found it downloads it, then installs and relaunches on request. Background check errors stay silent. Builds without the native updater report that automatic updates aren't available.
  • A Ready to update! toast offers Update now once the download finishes. It stays hidden while Settings → Updates is open, because that page shows the same action. Dismissing the toast holds until the update resolves.
  • New Settings → Updates section ("Software Updates") with check, retry and apply actions.
  • Native: tauri-plugin-updater is registered only in release builds compiled with BUZZ_UPDATER_PUBLIC_KEY and BUZZ_UPDATER_ENDPOINT (the buzz_updater_enabled cfg in build.rs). tauri-plugin-process provides relaunch. The main-window capability grants updater:allow-check, updater:allow-download, updater:allow-install, core:resources:allow-close and process:allow-restart. The JS and Rust updater versions match (2.12.0).
  • Docs: docs/configuration.md, docs/settings.md.

Publishing updates needs release configuration: the updater public key and endpoint at build time, a plugins.updater config with createUpdaterArtifacts, the Tauri signing key, updater artifacts signed after notarization, and a published latest.json.

Testing

  • updates.test.ts, UpdateNotice.test.tsx, UpdateSettings.test.tsx, Settings.test.tsx: lifecycle, merging, background interval, disposal, error mapping, toast and settings states.
  • tests/browser/updates.spec.mjs (Chromium and WebKit) runs the real updater and process JS clients against IPC gated by capabilities/default.json. It covers check, failure and retry, download, restart from the toast, releasing both native resources after a failed install before retrying, and, at the default 1200×800 window, the toast yielding to Settings → Updates.
  • pnpm check; Vitest; settings, updates and plugin-import browser specs in both engines; cargo fmt, cargo clippy (with updater env set) and a release tauri build.

peon and others added 3 commits September 26, 2026 08:25
Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
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