Skip to content

[Feat|Local] Auto-update and stable release channel - #1773

Merged
CREDO23 merged 8 commits into
devfrom
workstream-a
Sep 14, 2026
Merged

CREDO23 merged 8 commits into
devfrom
workstream-a

Conversation

@CREDO23

@CREDO23 CREDO23 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Opt-in auto-update in the Electron main process via electron-updater: off by default, Settings › General gets a "Check for updates automatically" switch and a "Check now" row; download starts only after a check the user enabled or clicked, install always waits for "Restart to update"
  • Update state (checking, downloading, ready, up-to-date, error) is pushed to the renderer over IPC; a banner offers the restart once a version is downloaded
  • New app publishes on the stable update channel (stable-*.yml); the legacy 0.0.x desktop reads latest-*.yml, which no release produces anymore, so it can never update into the new app and no release needs pinning
  • Mac builds dmg + zip; the updater installs from the zip. Differential download is off, GitHub's CDN rejects the multi-range requests it needs
  • desktop-release.yml (legacy desktop) deleted; release-local.yml now triggers on v* and is the only desktop release workflow; docker-build.yml builds hosted images from v0.* tags only
  • Dry-run artifact upload includes *.zip, *.deb, *.blockmap, *.yml so a workflow_dispatch run can be checked for the channel files

Test plan

  • pnpm typecheck and pnpm test in surfsense_local/electron; pnpm test in surfsense_local/frontend
  • Dev build: Settings › General shows the updates row idle; switch and "Check now" do nothing in dev
  • After merge: workflow_dispatch on Desktop Release, publish: never, all targets; artifacts contain stable-mac.yml, stable.yml, stable-linux.yml, a mac .zip, and no latest-*.yml
  • Two dry-run builds at different versions: install the lower one, serve the higher one's stable-*.yml + installer locally, confirm "Check now" downloads it and "Restart to update" installs it (mac, Windows, AppImage)
  • Legacy desktop v0.0.40 pointed at a release without latest-mac.yml: startup check logs "update check skipped", no dialog

High-level PR Summary

This PR implements opt-in auto-update functionality for the desktop app using electron-updater with a new stable release channel. Updates are off by default and can be enabled via a new switch in Settings › General, with a "Check now" button available regardless of the setting. When an update is downloaded, a banner appears offering the user to restart and install. The release workflow is consolidated from two separate workflows into a single release-local.yml that triggers on v* tags and publishes to the stable channel (via stable-*.yml files), ensuring the legacy 0.0.x desktop (which reads latest-*.yml) can never auto-update into the new app. Mac builds now produce both dmg and zip formats, with the updater installing from the zip. Differential downloads are disabled due to GitHub CDN limitations.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_local/electron/src/main/updater.test.mts
2 surfsense_local/electron/src/main/updater.mts
3 surfsense_local/electron/electron-builder.yml
4 surfsense_local/electron/package.json
5 surfsense_local/electron/src/main/index.ts
6 surfsense_local/electron/src/preload/index.ts
7 surfsense_local/frontend/src/lib/api.ts
8 surfsense_local/frontend/src/features/updates/update-settings.test.tsx
9 surfsense_local/frontend/src/features/updates/update-settings.tsx
10 surfsense_local/frontend/src/features/settings/settings-dialog.tsx
11 surfsense_local/frontend/src/app/app-bootstrap.tsx
12 .github/workflows/release-local.yml
13 .github/workflows/docker-build.yml
14 .github/workflows/desktop-release.yml
15 surfsense_local/electron/pnpm-lock.yaml

Need help? Join our Discord

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6ab06e61-7319-4b91-885e-cedc64ba4b13

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
surf-sense-frontend Ready Ready Preview Sep 14, 2026 12:43pm UTC

Request Review

@CREDO23
CREDO23 merged commit bab923e into dev Sep 14, 2026
5 of 8 checks passed
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