Skip to content

feat(update): report a newer release on an Updates page (#101) - #102

Merged
elementalvoid merged 1 commit into
mainfrom
feat/update-check
Nov 14, 2026
Merged

elementalvoid merged 1 commit into
mainfrom
feat/update-check

Conversation

@elementalvoid

Copy link
Copy Markdown
Owner

Closes #101.

Summary

The client now asks GitHub for the newest published release at startup and at most once every 24 hours, and says so without installing anything (ADR 0009). One request, three cues: a system notification, one item each in the tray menu and the macOS app menu, and the new Updates page.

GitHubSource.latest()                       the app's tokio worker, 15 s bound
  GET /releases/latest  (Accept, User-Agent)
  tag_name, html_url, body  ->  Version::parse  ->  Release
UpdateModel                                 app scope, survives the window
  start() / set_enabled(true)               one loop: check, sleep 24 h, check
  answer task -> apply()                    newer? Available : UpToDate | Failed
  latches: last announced version, dismissed version
SettingsView · Updates (PAGES[6])
  Check for updates  … status on the same line  … switch
  New release available (only when one is)
    notes (TextView::markdown, box fills the page)
    Open release page | Don't remind me about X   (one line)
crates/app/src/update.rs        the check: tag parse, response fields, source
                                trait, model, notice — all of R12's rules
crates/app/src/shell.rs         ShowUpdatePane, the two menu items, the app
                                scope handle, start_updates on the real boot
crates/app/src/settings.rs      check_for_updates, dismissed_update
crates/app/src/settings_view.rs the seventh page and its own body
docs/adr/0009-…                 why it never installs

Failure is silence: a timeout, a 403, a 5xx, an unparsable body, or a tag this client cannot compare is one info line and the page's "Could not check" sentence; the next attempt is the next interval. A silenced release is stored as its version, so it stays quiet across restarts and the next release speaks.

The kit renders a page as a list measured to its content (gpui-component-0.8.1/src/setting/page.rs:125), so a row cannot grow with the window; the Updates page draws its own body — one a11y::named tab panel, Row::render for the switch, and a framed notes box with flex_1. The comment in the code says why, and why Scrollable::overflow_y_scrollbar cannot carry the app's wheel rule (#54).

Evidence

  • Before: no Updates page; the only network traffic was the Immich server, which the README promised. After: Settings › Updates, with the check's answer on the switch's line, and the release state showing the live v0.3.0 notes.
    • Captures (real frames from the recipe in CONTRIBUTING.md › Screenshots, Xvfb + lavapipe): 1200x900 and the 520x480 minimum, light and dark, plus the dismissed state. The release-state frames came from the same code built as 0.2.0, so the live v0.3.0 release is genuinely newer; the shipped 0.3.0 build says "Up to date (0.3.0)." No test touches the network — FakeReleases is behind the ReleaseSource trait.
    • The captures found one defect tests could not: the clipped notes needed a frame (it read as the end of the text) and the page needed its own scrollbar at the 480 px floor.
$ cargo test -p immich-sync
test result: ok. 128 passed            (unit: tag parse, response fields,
                                        latches, the notice, menu items)
test result: ok. 310 passed            (it: cadence with the fake, every page
                                        state, the action landing on the page,
                                        the dismissal surviving a reload)

One pre-existing failure is unrelated and reproduces on main: log_redaction::a_real_sign_in_never_writes_a_secret_to_the_log fails when the whole binary runs in parallel ("a global default trace dispatcher has already been set") and passes alone.

cargo fmt --all -- --check clean; cargo clippy -p immich-sync --all-targets clean apart from one pre-existing sync-core warning. The 520 px minimum is covered by the existing narrow-window test, which now walks seven tabs and the new row.

Merge Danger

Door: two-way. A new default-on switch, one outbound request, and one page; no data is migrated, changed, or deleted, and turning the switch off restores the old behaviour exactly.

Blast Radius: limited — one crate, one new module, one settings pair, one page, two menu items; the README privacy promise changes, which users read.

Skipped here: the tray and macOS menu wiring is asserted headlessly only, not on real hardware; the 24 h loop is proven at short intervals in tests.

The client reads GitHub's newest published release at startup and at most
once every 24 hours, on the tokio runtime it already holds. A newer release
raises one system notification and one item each in the tray menu and the
macOS app menu, and all three entry points open the new Updates page: the
seventh settings page, appended so the six existing indices stay put.

The page is one switch with the check's answer on the same line, then, for a
newer release, a "New release available" line, the notes as Markdown in a
framed box that fills the height the page has left, and one line holding the
release-page button and the remind control. A silenced release is stored by
its version, so it stays quiet across restarts and the next release speaks.

The kit draws a page as a list measured to its content, so this page cannot
fill from a row; it draws its own body and says why. Nothing is downloaded or
installed (ADR 0009). Failure is silence: one info line and the page's "Could
not check" sentence, and the next attempt is the next interval.

The one other network request changes the README's privacy promise, so it
names the request and the switch there, and SPEC gains R12.
@elementalvoid
elementalvoid merged commit 5e754e9 into main Nov 14, 2026
4 checks passed
@elementalvoid
elementalvoid deleted the feat/update-check branch November 14, 2026 20:06
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.

Update check: report a newer release on an Updates page

1 participant