Skip to content

Add in-app update check - #22

Merged
aquitaine merged 1 commit into
mainfrom
update-checker
Jul 19, 2026
Merged

Add in-app update check#22
aquitaine merged 1 commit into
mainfrom
update-checker

Conversation

@aquitaine

@aquitaine aquitaine commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Replaces the menu's "Check for updates — Soon" placeholder with a working updater.

  • TopologyCore (pure, +15 tests): SemanticVersion (tolerant parse: v prefix, pre-release suffixes, garbage → nil) and UpdateCheckPolicy (compare + daily auto-check throttle; unparseable tags never produce an update prompt; future lastCheck counts as due).
  • App: UpdateChecker does one anonymous GET to releases/latest; AppModel publishes the state; the menu row shows check → checking → up-to-date / version badge → release page. Launch auto-check at most once a day, default on, toggleable in Health & Recovery. Nothing auto-downloads.

301 tests green; both app schemes build.

Pure SemanticVersion + UpdateCheckPolicy (version compare, daily
auto-check throttle) in TopologyCore with 15 tests. App-side
UpdateChecker fetches GitHub releases/latest anonymously; AppModel
publishes idle/checking/upToDate/available state. The menu's 'Check for
updates' row goes live (was a 'Soon' pill): manual check, live status,
and an accent version badge that opens the release page when an update
exists. Auto-check runs at launch, at most daily, gated by a new
updateCheckEnabled setting (default on) with a Health & Recovery toggle.
Nothing is downloaded automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aquitaine
aquitaine merged commit 0aaad73 into main Jul 19, 2026
@aquitaine
aquitaine deleted the update-checker branch July 19, 2026 23:08

@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: 1d2e355276

ℹ️ 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".

func autoCheckForUpdatesIfDue() async {
guard settings.updateCheckEnabled else { return }
let last = UserDefaults.standard.object(forKey: Self.lastUpdateCheckKey) as? Date
guard UpdateCheckPolicy.shouldAutoCheck(lastCheck: last, now: Date()) else { return }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the update result across throttled launches

When an automatic check finds an available release, only the check timestamp is persisted. If the app relaunches within 24 hours, updateState starts as .idle and this guard returns without restoring the previous .available result, so the update badge disappears until the user manually checks or the interval expires. Cache and restore the availability result, or otherwise repopulate the state when skipping the request.

Useful? React with 👍 / 👎.

@aquitaine aquitaine mentioned this pull request Jul 19, 2026
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.

2 participants