Add in-app update check - #22
Conversation
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>
There was a problem hiding this comment.
💡 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 } |
There was a problem hiding this comment.
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 👍 / 👎.
Replaces the menu's "Check for updates — Soon" placeholder with a working updater.
SemanticVersion(tolerant parse:vprefix, pre-release suffixes, garbage → nil) andUpdateCheckPolicy(compare + daily auto-check throttle; unparseable tags never produce an update prompt; future lastCheck counts as due).UpdateCheckerdoes one anonymous GET toreleases/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.