Repository navigation
Add an app update checker that surfaces newer NodeSpace releases - #1881
Merged
Merged
Conversation
Detect-only (no auto-update): compare the running app version against the latest published GitHub release with semver semantics, so 0.10.0 correctly beats 0.9.0. The check is best-effort — offline, timeout, rate limit, or a malformed/missing tag all resolve to "no update known", never an error, and it runs on a background task so it can't delay startup. - `update_check` module: pure version-compare + release-JSON parse helpers (unit-tested without the network) wrapped by a short-timeout GitHub fetch that swallows every failure. - `check_for_update_command` Tauri command for on-demand checks. - A startup spawn that emits `update://available` (with the current/latest versions) only when a strictly-newer release exists, so the frontend banner appears solely on a real update. The running version comes from Tauri's `PackageInfo` (the shipped `tauri.conf.json` version) rather than `CARGO_PKG_VERSION`, so a build that bumps `tauri.conf.json` without `Cargo.toml` can't report a stale version and nag against its own release. Adds `reqwest` (rustls) + `semver` to the desktop app. The non-blocking banner UI that listens for the event, and live validation against real releases, are the frontend/on-device half. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE Adversarial review traced every path in
The one MINOR it raised — |
This was referenced Aug 1, 2026
Closed
mstomar125
added a commit
that referenced
this pull request
Aug 1, 2026
closes #1321, #1887) Completes the app-update manager on the merged detection backend (#1881): a non-blocking update banner, plus a consistent pre-migration database backup so a new release can never lose the user's data. Update prompt (#1321): update-status store subscribes to the startup update://available event + runs one on-demand check_for_update_command; a per-version-dismissible UpdateBanner (mounted in the app shell) offers Download (opens the release page — the bundle is unsigned, no in-app installer) and Later. Data safety — no data loss on update (#1887): before any pending migration runs AND when the db holds data, snapshot it with SQLite's consistent hot-backup (VACUUM INTO) to a backups/ sibling dir, pruned to 5. Wired into SqliteStore::new (best-effort — logged, never blocks startup). Completes the three-layer guarantee: data lives outside the app bundle; migrations are transactional (crash-safe); and now a committed bad/destructive migration is recoverable from the snapshot. Hardened after adversarial review: - VACUUM INTO (not checkpoint+file-copy): a transactionally-consistent snapshot even if another connection holds the db or has un-checkpointed WAL — the previous copy could silently omit WAL data under daemon+CLI concurrency. - Gate on real data (a populated node table), not user_version==0, so a pre-versioning db at version 0 with data is still protected and empty dbs skip. - Nanosecond + pid in the backup filename so two processes can't collide. - app-shell cleanup now calls updateStatus.stop() (no leaked listener). Tests: 6 migration-backup unit tests (data preserved in the snapshot, populated version-0, empty-skip, current-skip, brand-new-skip) + an end-to-end SqliteStore::new wiring test; 7 update-store tests. Live-validated against a real 185-node v2 profile: the daemon snapshots (v2/185) then migrates the live db to v3. Co-Authored-By: Claude Opus 4.8 <[email protected]>
mstomar125
added a commit
that referenced
this pull request
Aug 1, 2026
closes #1321, #1887) (#1889) Completes the app-update manager on the merged detection backend (#1881): a non-blocking update banner, plus a consistent pre-migration database backup so a new release can never lose the user's data. Update prompt (#1321): update-status store subscribes to the startup update://available event + runs one on-demand check_for_update_command; a per-version-dismissible UpdateBanner (mounted in the app shell) offers Download (opens the release page — the bundle is unsigned, no in-app installer) and Later. Data safety — no data loss on update (#1887): before any pending migration runs AND when the db holds data, snapshot it with SQLite's consistent hot-backup (VACUUM INTO) to a backups/ sibling dir, pruned to 5. Wired into SqliteStore::new (best-effort — logged, never blocks startup). Completes the three-layer guarantee: data lives outside the app bundle; migrations are transactional (crash-safe); and now a committed bad/destructive migration is recoverable from the snapshot. Hardened after adversarial review: - VACUUM INTO (not checkpoint+file-copy): a transactionally-consistent snapshot even if another connection holds the db or has un-checkpointed WAL — the previous copy could silently omit WAL data under daemon+CLI concurrency. - Gate on real data (a populated node table), not user_version==0, so a pre-versioning db at version 0 with data is still protected and empty dbs skip. - Nanosecond + pid in the backup filename so two processes can't collide. - app-shell cleanup now calls updateStatus.stop() (no leaked listener). Tests: 6 migration-backup unit tests (data preserved in the snapshot, populated version-0, empty-skip, current-skip, brand-new-skip) + an end-to-end SqliteStore::new wiring test; 7 update-store tests. Live-validated against a real 185-node v2 profile: the daemon snapshots (v2/185) then migrates the live db to v3. Co-authored-by: Claude Opus 4.8 <[email protected]>
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
Detect-only app update checker (no auto-update): on startup the app checks whether a newer NodeSpace release exists and, if so, surfaces it non-blockingly. Closes the backend/detection half of the update-checker requirement.
update_checkmodule (packages/desktop-app/src-tauri/src/update_check.rs): pureupdate_available(semver compare —0.10.0beats0.9.0, which lexicographic would get wrong),parse_version(tolerates a leadingv), andlatest_tag_from_json— all unit-tested without the network — wrapped bycheck_for_update, a 5s-timeout GitHubreleases/latestfetch that swallows every failure (offline, timeout, rate limit, malformed/missing tag) to a "no update known" result.check_for_update_commandTauri command for on-demand checks (menu item / on mount).lib.rs): fire-and-forget ontauri::async_runtime::spawnso it can never delay startup; emitsupdate://available(payload: current + latest version) only when a strictly-newer release exists — no event on up-to-date or on any failure, so the banner appears solely on a real update.Decisions
/latestof this repo (releases are the installable artifacts). The endpoint excludes drafts/prereleases — "what a user can install".PackageInfo(the shippedtauri.conf.jsonversion), notCARGO_PKG_VERSION— so a build that bumpstauri.conf.jsonwithoutCargo.tomlcan't report a stale version and nag against its own release. (Applied from review.)reqwest(rustls-tls, no OpenSSL) +semver.Tests
8 unit tests: semver-not-lexicographic, equal/older are not updates, leading-
vtolerance both sides, prerelease < release, garbage never claims an update,tag_nameparsed from release JSON, rate-limit/error JSON → none, no-update status shape. Full pre-push gate green (test:all+cargo build --bin nodespaced+test:e2e+cargo test -p nodespace-app), clippy-D warningsclean.Deferred to on-device (Mac)
The non-blocking banner component that listens for
update://available(register the listener on mount, or callcheck_for_update_commanddirectly), and live validation against real GitHub releases. Note for the frontend: the startup emit is fire-once with no replay, so register the listener before/independently of relying on the startup event, or call the command on mount.Co-Authored-By: Claude Opus 4.8 [email protected]