Repository navigation
Auto-update manager: update-available banner + pre-migration DB backup (closes #1321, #1887) - #1889
Merged
Merged
Conversation
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
force-pushed
the
issue-1321-auto-update-manager
branch
from
August 1, 2026 11:28
5c01c11 to
730beb2
Compare
Contributor
Author
|
APPROVE (self-review + adversarial review addressed; data-safety = full rigor). Adversarial review found real gaps in the first cut — all fixed in 730beb2:
Live-validated on real data: built the daemon, booted against a sandbox copy of a real profile (v2, 185 nodes) → logged "Backed up database before applying pending migrations from_version=2 to_version=3"; live db migrated to v3, and the Tests: 6 migration-backup unit + 1 end-to-end |
This was referenced Aug 1, 2026
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
Completes the app-update manager on the merged detection backend (#1881): users get a non-blocking update-available banner, and — the piece a prospective client is blocking on — a pre-migration database backup so a new release can never lose their data.
Update prompt (closes #1321)
stores/update-status.svelte.ts: subscribes to the startupupdate://availableevent and runs one on-demandcheck_for_update_command(so a webview reload still learns of an update);showBanneris dismissible per version (localStorage) — dismissing 0.3.0 re-appears at 0.4.0.components/update-banner.svelte(mounted in the app shell): "NodeSpace <latest> is available" with Download (opens the release page — the bundle is unsigned and ships no in-app installer) and Later.Data safety — no data loss on update (closes #1887)
migrations::backup_before_pending_migrations: before any pending migration runs (user_version∈ (0, LATEST)), WAL-checkpoint then copy the DB file to<db_dir>/backups/<stem>.v<cur>.<ts>.bak, pruned to the last 5. Wired intoSqliteStore::new(best-effort — a backup failure is logged, never blocks startup).Tests
SqliteStore::newwiring test (an existing pre-migration db is snapshotted, then migrated to LATEST).Follow-ups
nodespace-sync) releases; needs an infra decision (worker proxy + GitHub read secret, or a public Pro manifest). The free-user path is fully covered here..bakback).Interactive visual confirmation of the banner defers to a desktop session (requires a live update-available state).
Co-Authored-By: Claude Opus 4.8 [email protected]