feat(updates): add in-app auto-updates with restart toast - #312
Draft
kalvinnchau wants to merge 3 commits into
Draft
kalvinnchau wants to merge 3 commits into
kalvinnchau wants to merge 3 commits into
Conversation
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>
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.
In-app auto-updates, ported from block/buzz desktop with its copy.
src/features/updates/updates.tsis 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.tauri-plugin-updateris registered only in release builds compiled withBUZZ_UPDATER_PUBLIC_KEYandBUZZ_UPDATER_ENDPOINT(thebuzz_updater_enabledcfg inbuild.rs).tauri-plugin-processprovides relaunch. The main-window capability grantsupdater:allow-check,updater:allow-download,updater:allow-install,core:resources:allow-closeandprocess:allow-restart. The JS and Rust updater versions match (2.12.0).docs/configuration.md,docs/settings.md.Publishing updates needs release configuration: the updater public key and endpoint at build time, a
plugins.updaterconfig withcreateUpdaterArtifacts, the Tauri signing key, updater artifacts signed after notarization, and a publishedlatest.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 bycapabilities/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,updatesandplugin-importbrowser specs in both engines;cargo fmt,cargo clippy(with updater env set) and a releasetauri build.