Skip to main content

Module update

Module update 

Source
Expand description

Update awareness and (where permitted) self-update.

On launch the app asks GitHub whether a newer stable kimun-notes-v* exists and surfaces the result; on self-update-eligible channels it can also swap the binary in place. All network and filesystem work here is blocking — callers run it on tokio::task::spawn_blocking so the TUI never stalls.

Design: adr/0013 (channel restriction) and adr/0014 (hand-rolled mechanics). User-owned config (update_check) lives in config.toml; machine-managed state (throttle, last-known version, dismissals) lives in update_state.toml.

Structs§

LatestRelease
The newest stable app release and everything needed to download it.
UpdateState
UpdateStatus
The outcome of an update check, ready to drive the UI.

Enums§

InstallChannel
UpdateError
Anything that can go wrong during an update check or self-update.

Constants§

CURRENT_VERSION
The version compiled into this binary.

Traits§

ReleaseProvider
Source of release information for the self-updater. Implement this and swap the constructor in [super::provider] to change backends without touching any caller.

Functions§

apply
Download, verify, and install latest, replacing the running binary. Blocking — prefer the async install.
check
Check for an update (blocking — prefer the async check_now).
check_now
Async check — runs on the blocking pool so the caller’s runtime is never stalled.
dismiss
Record that the user dismissed version, suppressing the notification until a newer release appears. Writes only update_state.toml.
fetch_latest
Fetch the full latest release (with downloadable assets), needed before apply. Blocking — prefer the async latest_release.
install
Async apply — consumes latest so it can move onto the blocking pool.
latest_release
Async fetch_latest.
releases_url
Human-facing releases page for the active provider (shown when self-update isn’t available on the current install channel).
status_for
Compute the UpdateStatus for an already-fetched latest release and persist the check timestamp/version. Lets a caller that already holds a LatestRelease (the apply path) avoid a second GitHub round-trip.