Skip to content

Add hardened auto-update with immutable release notes artifacts#306

Open
zortos293 wants to merge 4 commits intodevfrom
capy/hardened-auto-update
Open

Add hardened auto-update with immutable release notes artifacts#306
zortos293 wants to merge 4 commits intodevfrom
capy/hardened-auto-update

Conversation

@zortos293
Copy link
Copy Markdown
Collaborator

@zortos293 zortos293 commented Apr 14, 2026

This PR implements a production auto-update system for OpenNOW that checks GitHub Releases and prefers immutable versioned release-notes assets, with a full UI in Settings → Miscellaneous.

Main process:

  • opennow-stable/src/main/updater.ts: Encapsulates all electron-updater logic, maintains typed in-memory updater state (status, progress, release info), and broadcasts sanitized state to the renderer. Prefers release-notes-v<version>.json from the matching GitHub release tag, with graceful fallback to mutable feed notes.
  • opennow-stable/src/main/index.ts: Registers updater IPC handlers for get-state, check, download, install, and skip; initializes updater after settings manager; schedules a quiet background startup check.
  • opennow-stable/src/main/settings.ts: Adds autoCheckForUpdates (default true) and skippedUpdateVersion settings with backward-compatible defaults.

Contracts and bridge:

  • opennow-stable/src/shared/gfn.ts: Adds UpdaterState, UpdaterStatus, UpdaterReleaseNotesSource, UpdaterDownloadProgress, ReleaseNotesArtifact, and extends OpenNowApi with updater methods and event subscription.
  • opennow-stable/src/shared/ipc.ts: Adds UPDATES_GET_STATE, UPDATES_CHECK, UPDATES_DOWNLOAD, UPDATES_INSTALL, UPDATES_SKIP, UPDATES_CLEAR_SKIPPED, and UPDATES_STATE_CHANGED channels.
  • opennow-stable/src/preload/index.ts: Wires updater IPC through the preload bridge and exposes onUpdaterStateChanged event.

Renderer:

  • opennow-stable/src/renderer/src/App.tsx: Subscribes to updater state changes, hydrates initial state from main process, and passes updaterState down to SettingsPage.
  • opennow-stable/src/renderer/src/components/SettingsPage.tsx: Adds an update panel in Miscellaneous showing current version, status, available version/tag, download progress bar with speed, release notes source badge and notes viewer. Provides Check Now, Download, Restart to Install, and Dismiss/Show Again actions.
  • opennow-stable/src/renderer/src/styles.css: Adds styles for the update panel, summary cards, progress bar, release notes card, and error box.

Packaging and workflow:

  • opennow-stable/package.json: Adds electron-updater dependency, sets electronUpdaterCompatibility: ">=2.16" in build config, and keeps GitHub as the publish provider.
  • .github/workflows/release.yml: Ensures build artifacts include *.yml and *.blockmap files (updater metadata). Generates an immutable release-notes-v<version>.json artifact from GitHub's generated notes payload and attaches it to the release; uses the same markdown for the mutable release body.

Behavior:

  • Updater is only active in packaged production builds; manual checks in dev return a clear error instead of blocking.
  • Startup checks respect autoCheckForUpdates and run on a delay to avoid spam.
  • Release notes are fetched solely in the main process, tied to the exact discovered release tag/version.
  • Older releases without the notes asset fall back to feed notes automatically.

Open in Capy OPE-62 · 5.4

@zortos293 zortos293 added the capy Generated by capy.ai label Apr 14, 2026 — with Capy AI
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@capy-ai capy-ai bot left a comment

Choose a reason for hiding this comment

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

Added 1 comment

zortos293 and others added 2 commits April 14, 2026 18:22
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant