Skip to content

Check the update feed from the desktop app - #3215

Merged
capy-ai-staging[bot] merged 5 commits into
mainfrom
desktop-updater-check
Nov 14, 2026
Merged

capy-ai-staging[bot] merged 5 commits into
mainfrom
desktop-updater-check

Conversation

@jamiepine

@jamiepine jamiepine commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

The desktop app registered tauri-plugin-updater but nothing called it: useAutoUpdater had no callers, so the latest.json that #3210 publishes was never read. With this change, beta.1 can be offered beta.2 in the app.

Check and prompt. The main window checks the feed at startup and every six hours. A new version shows a sonner toast from @spacedrive/primitives that stays until you act, with Install and restart and Later. The same version is offered once per session. A failed or offline check only writes console.debug. Nothing downloads before you choose Install and restart. That step downloads and verifies the update against the pubkey in tauri.conf.json, installs it, then relaunches. A failure after you click shows an error toast.

Release builds only. Platform.checkForUpdate is optional. The Tauri platform defines it only when import.meta.env.PROD is true and VITE_SD_UPDATER === 'true', so the web app, dev builds, and local tauri build runs never check. release.yml sets VITE_SD_UPDATER: 'true' on the tauri-action step, and that is the only workflow change. The nightly workflow builds no desktop app. Windows is unchanged: latest.json has no Windows entry, so a Windows check finds nothing and stays silent.

Restart. A new restart_after_update command replaces tauri-plugin-process, so no crate is added. The daemon the app spawned outlives the app, and a relaunched app attaches to whichever daemon answers. Without this step, the new build would keep running against the old daemon. The command finds the daemon the app spawned, either this launch's child or the PID recorded in desktop-daemon.pid by an earlier launch, checked by name and liveness. It sends that daemon Shutdown (as sd update does), waits up to 30 s, kills it if it is still running, then calls app.restart(). The record is deleted whenever the app hands the daemon to a service or stops it, so a daemon running as a service, or one started by the CLI, is never touched. updater:default was already in the capabilities, and a custom app command needs no permission entry.

Shape. The hook now runs on usePlatform(), not a @ts-expect-error dynamic import, and AvailableUpdate is exported from @sd/interface. @tauri-apps/plugin-updater is pinned to ~2.9.0 to match the crate in Cargo.lock. The unused updater.example.ts is removed. docs/core/releases.mdx describes the flow, and PROJECT_STATUS.md has a register row.

Tests. bun test src/hooks/useAutoUpdater.test.ts covers the check schedule: it checks immediately and on each interval, offers each version once, keeps going silently after a failure, and does not prompt after stop. bun run typecheck and cargo check on the Tauri crate pass. A local end-to-end run is described in a PR comment: a 2.0.0-beta.0 .deb, a local feed signed with a throwaway key, the prompt, then install, daemon stop and relaunch.

Open in Capy

jamiepine and others added 2 commits November 14, 2026 12:04
Co-authored-by: capy-ai-staging[bot] <305915985+capy-ai-staging[bot]@users.noreply.github.com>
Co-authored-by: capy-ai-staging[bot] <305915985+capy-ai-staging[bot]@users.noreply.github.com>

@capy-ai-staging capy-ai-staging Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

View 1 other finding in Capy.

Open in Capy

Comment thread apps/tauri/src-tauri/src/main.rs Resolved
Co-authored-by: capy-ai-staging[bot] <305915985+capy-ai-staging[bot]@users.noreply.github.com>

@capy-ai-staging capy-ai-staging Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

Open in Capy

Comment thread apps/tauri/src-tauri/src/main.rs Resolved
Co-authored-by: capy-ai-staging[bot] <305915985+capy-ai-staging[bot]@users.noreply.github.com>

@capy-ai-staging capy-ai-staging Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

Open in Capy

Comment thread apps/tauri/src-tauri/src/main.rs Resolved
Co-authored-by: capy-ai-staging[bot] <305915985+capy-ai-staging[bot]@users.noreply.github.com>

@capy-ai-staging capy-ai-staging Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@capy-ai-staging

Copy link
Copy Markdown
Contributor

End-to-end check on Linux (Ubuntu 24.04, x86_64), run on 4db61e4. The later commits change only the ownership of the daemon PID file; the update flow itself is unchanged.

Update prompt

What I ran:

  1. tauri signer generate made a throwaway key, 0088E253E0EAF078. The committed config was not edited. A --config overlay set version: 2.0.0-beta.0, the throwaway pubkey, endpoints: ["http://127.0.0.1:8765/latest.json"] and dangerousInsecureTransportProtocol: true.
  2. VITE_SD_UPDATER=true TAURI_SIGNING_PRIVATE_KEY=<throwaway> tauri build --bundles deb --config proof.conf.json produced Spacedrive_2.0.0-beta.0_amd64.deb and its .sig.
  3. A local latest.json with version: 2.0.0-beta.1 and a linux-x86_64 entry pointing at that same .deb and signature was served with python3 -m http.server 8765. The beta.0 .deb was installed with apt.
  4. Launched /usr/bin/Spacedrive. It fetched latest.json about a second after the daemon connected, and the prompt above appeared.
  5. Clicked Install and restart. Plugin log: download (GET /feed.deb), signature check, installed deb with sudo. App log: Daemon stopped for update pid=177880, then Restarting to finish the update. The relaunched app (new pid) found no daemon, started a new one, recorded its PID, and checked the feed again.

Afterwards I removed the package, deleted the throwaway key, and stopped the server. Nothing from the proof run is in the branch.

@capy-ai-staging
capy-ai-staging Bot merged commit 264fdae into main Nov 14, 2026
13 checks passed
@capy-ai-staging
capy-ai-staging Bot deleted the desktop-updater-check branch November 14, 2026 12:46
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