Skip to main content

Module updater

Module updater 

Source
Expand description

Auto-updater logic using tauri-plugin-updater.

§Responsibilities

  • UpdateStatus — serializable state machine shared with the frontend.
  • check_for_update — asks the updater endpoint whether a newer version is available.
  • install_update — downloads and stages the pending update so Tauri can restart into it.

§OCP

UpdateStatus is open for new variants. The frontend discriminates on the status field (a type tag), so adding a variant here only requires a new branch in the frontend switch. Existing arms are unaffected.

Enums§

UpdateStatus
Every state the updater can be in.

Functions§

check_for_update
Check the configured updater endpoint for a newer version.
install_update
Download and stage the pending update, emitting Downloading { progress } events along the way so the UI’s progress bar can advance.
restart
Restart the application process. Used by UpdaterPrompt after the Ready state — window.location.reload() only reloaded the WebView in the SAME binary so the freshly-installed update never took effect. AppHandle::restart() exits and re-execs the staged binary.