feat: Mac-only auto-update via treq.dev/version - #238
Draft
Ziinc wants to merge 3 commits into
Draft
Conversation
Check the published /version endpoint on startup (and from Help/Settings), and on macOS download+install the matching GitHub .app.tar.gz release artifact when a newer version is available. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
There was a problem hiding this comment.
UI stays out of the Rust install path: the hook only decides when to prompt and confirm.
- Startup check is delayed ~2.5s so it doesn’t contend with first-paint repo load
autoCheck/listenMenulet Settings reuse the same prompt without double-subscribing to Help → Check for Updates- Actionable toasts no longer auto-dismiss (see
toast.tsx) so “Install and restart” survives until the user acts
There was a problem hiding this comment.
Command layer stays thin on purpose — validate + delegate, no business logic.
TREQ_WEB_URLoverride keeps local/dev checks pointed at a non-prod origin when needed- Download URL allowlist is limited to
github.com/treq-dev/treq/releases/download/so a compromised/versionhost can’t redirect installs elsewhere app.restart()afterdittois what actually picks up the replaced bundle on macOS
There was a problem hiding this comment.
Version discovery is intentionally a plain-text fetch of /version rather than Tauri’s signed updater protocol — that endpoint already ships on treq.dev and keeps the check independent of release-asset signing.
- Semver + URL builders are pure so CI can cover them without network I/O
- Install stays behind
auto_update_supported()(cfg(target_os = "macos")) so Linux/Windows builds compile the same code but never download - Download URLs mirror the existing GitHub asset names (
treq_aarch64/treq_x64)
Use core::app_version() so the NAPI bridge and Tauri command share the same CARGO_PKG_VERSION, and add a screenshot QA spec for the Settings update controls. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
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
Adds automatic update checking against the marketing-site
/versionendpoint, with install enabled on macOS only.Behavior
https://treq.dev/versionand compares it to the treq crate version.treq_{aarch64|x64}.app.tar.gz), replaces the running.appbundle viaditto, and relaunches.Implementation notes
src-tauri/src/core/auto_update.rs(TDD’d: semver parse/compare, URL construction, fetcher injection, Mac-only install gate).check_for_app_update,install_app_update(trusted GitHub release URL prefix only).check_for_app_updateviacore::app_version()so tests see the same version as the desktop app.scripts/screenshot/specs/auto-update-settings.spec.tsx.Out of scope
supportedis false)..sigartifacts (uses existing unsigned.app.tar.gzrelease assets).Screenshots
Settings Check for updates
macOS-only toast
Install and restart toast
To show artifacts inline, enable in settings.