Skip to content

Desktop: the app updates itself on Windows (D38) - #53

Merged
codevector-2003 merged 2 commits into
mainfrom
app-updates
Nov 24, 2026
Merged

codevector-2003 merged 2 commits into
mainfrom
app-updates

Conversation

@codevector-2003

Copy link
Copy Markdown
Owner

The desktop app now checks for new versions, and on Windows installs them itself.

What the person sees

  • A daily check. At start, and while the app stays open once a day has passed, it asks GitHub for the latest release. It stays silent unless there is a newer version that was not skipped.
  • A note in the title bar: "Update to 0.4.4", where running jobs show. Its panel has what is new (GoReleaser's changelog without the hashes), a link to the release notes, and Update and restart, Later, or Skip this version.
  • Update and restart, in order:
    1. "Downloading the update, n of m MB", with Cancel;
    2. "Checking the download";
    3. tabs saved, then "Restarting Filiation";
    4. the new version opens with "Filiation is up to date: 0.4.4. What is new".
  • Failures say what happened in the title bar: the download dropped, the checksum didn't match so it wasn't run, or Setup failed and the download page is offered.
  • Help menu: Check for Updates… always answers ("up to date", or "No connection…"). Check for Updates Automatically is a tick that turns the daily check off.
  • About shows when it last checked, and that the check sends nothing about the person or their library.
  • No self-update here: a copy not installed by Setup, the app on macOS and Linux, and dev builds offer the download page instead. Dev builds are never offered an update.

How it is built

  • internal/sources/github: the one place the app talks to GitHub.
    • The User-Agent is Filiation/<version>, and nothing else is sent.
    • The latest-release request has a 10 s timeout.
    • Files are streamed with a size cap, and must reach the release's own size.
  • internal/update:
    • compares versions, including pre-releases and dev;
    • cleans the notes;
    • downloads to %LOCALAPPDATA%\filiation\updates, deleting older downloads;
    • checks the SHA-256 against checksums.txt, deleting the file on a mismatch;
    • starts Setup with /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /CLOSEAPPLICATIONS /relaunch=yes.
  • internal/ui: GET /api/update, POST /api/update/download, GET /api/update/status, POST /api/update/cancel and POST /api/update/install. None of them needs a library open.
  • desktop/main.go: builds the updater. "Installed by Setup" means unins000.exe sits beside the exe. main.updateAPI can be set with -ldflags for test builds only.
  • filiation.iss: a new [Run] line opens the app after a silent install, only when /relaunch=yes is passed. Setup run by hand is unchanged.
  • Decision D38, docs/STATUS.md, the website's install page ("Updating the app"), and the home page and README mention Reader tabs and updating.

Checked

  • Unit tests:
    • version comparison;
    • release notes;
    • checksum parsing;
    • download, checksum and install against a fake GitHub (Setup is swapped out, never run);
    • a mismatched download is deleted and never run;
    • a copy not installed by Setup refuses to download;
    • a dev build is never offered an update;
    • the routes, offline included.
  • Live, in the Windows desktop app, on scratch folders. A 0.4.3 test build pointed at a local fake GitHub:
    • found 0.4.4 at start and showed the note and panel;
    • downloaded with progress and checked the checksum;
    • started the installer with the arguments above and closed;
    • a stand-in for Setup replaced the build with a 0.4.4 one and reopened it, which reported 0.4.4 and showed the after-update message;
    • the manual check answered "up to date", and "No connection" with the fake GitHub down.
  • Not tested live: real Inno Setup, which isn't installed on this machine, and running it would have written over the real install. CI's desktop build compiles the changed .iss. macOS and Linux are untested.

Versions 0.4.3 and earlier don't have this, so they update by hand once.

Once a day, and from Help, Check for Updates…, the app asks GitHub for the
latest release, naming itself and its version and sending nothing else. A
newer version shows "Update to …" in the title bar, with what is new, Update
and restart, Later, and Skip this version. Help, Check for Updates
Automatically turns the daily check off; About says when it last ran.

Update and restart, where Setup installed the app, downloads the release's
installer, checks its SHA-256 against the release's checksums.txt and
deletes it on a mismatch, saves the tabs, starts Setup silently with
/relaunch=yes, and closes. Setup's new [Run] line opens the new version
only when /relaunch=yes is passed, so Setup run by hand is unchanged. A copy
not installed by Setup, and macOS and Linux, offer the download page.

internal/sources/github is the one place the app talks to GitHub;
internal/update compares versions, cleans the release notes, downloads,
checks and starts Setup. The website's install page gains Updating the app,
and the home page and README mention Reader tabs and updating.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T13:56:11.401226Z fdc517d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fdc517dcee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/update/update.go Resolved
GoReleaser writes checksums.txt in the release job, before the Windows
installer is built and attached, so v0.4.3's checksums do not list it and
every update would have failed its check. The release workflow now adds the
installer's SHA-256 to checksums.txt and uploads it again, replacing any
line from an earlier run. The app reads the checksums when it checks, and
offers a release that does not list its installer as a download instead.
@codevector-2003
codevector-2003 merged commit c0cef3e into main Nov 24, 2026
7 checks passed
@codevector-2003
codevector-2003 deleted the app-updates branch November 24, 2026 14:01
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