Skip to content

feat(tauri): backend-driven Tauri update check and improved server auto-update scheduling#153

Merged
lcomplete merged 1 commit into
mainfrom
dev
Apr 30, 2026
Merged

feat(tauri): backend-driven Tauri update check and improved server auto-update scheduling#153
lcomplete merged 1 commit into
mainfrom
dev

Conversation

@lcomplete

Copy link
Copy Markdown
Owner

Summary

  • Add check_tauri_update Tauri command that fetches the latest.json manifest from GitHub releases and uses the updater plugin, removing the dependency on a hardcoded update endpoint
  • Persist server JAR release version in a sidecar .version file so the displayed version survives in-place JAR upgrades that strip embedded metadata
  • Replace the one-shot server auto-update flag with a proper 24-hour interval scheduler backed by localStorage, with correct cleanup on unmount/toggle
  • Move update status alerts (error, available, up-to-date, installed) inline with their respective settings sections; show current app/JAR version next to each heading
  • Fix Maven release build to pass -Drevision so the packaged JAR carries the correct version string

Test plan

  • Desktop app update check: click "Check for Updates" — confirm it shows up-to-date or available alert inline under the Desktop App Updates section
  • Server JAR update check: click "Check for Server Update" — confirm status appears inline under the Server JAR Updates section
  • Enable Automatic Server JAR Updates — confirm an immediate check fires; disable and re-enable after >24 h to verify the interval logic
  • Verify huntly-server.version file is written to app data dir after a successful server JAR install
  • Confirm ./mvnw clean verify passes and the packaged JAR name includes the correct version

🤖 Generated with Claude Code

… auto-update scheduling

- Add check_tauri_update Tauri command that fetches the latest.json manifest from GitHub releases and delegates to the updater plugin, bypassing the hardcoded endpoint limitation
- Persist server JAR release version in a sidecar version file so the displayed version survives JAR upgrades that strip metadata
- Replace one-shot server auto-update flag with a proper interval scheduler (24h, persisted via localStorage)
- Move update status alerts inline with their respective settings sections; show current app/JAR versions next to each heading
- Fix Maven release build to pass -Drevision so the packaged JAR carries the correct version string

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@augmentcode

augmentcode Bot commented Apr 30, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR reworks desktop and server update handling for the Tauri app to be driven by GitHub release metadata, while improving server auto-update scheduling and UI status display.

Changes:

  • Adds a new Tauri command check_tauri_update that fetches latest.json from GitHub releases and checks updates via the updater plugin
  • Persists the installed server JAR release version in a sidecar huntly-server.version file to survive in-place JAR upgrades
  • Replaces one-shot server auto-update with a 24-hour scheduler persisted in localStorage, including cleanup on unmount/toggle
  • Moves update status alerts inline under their related settings sections and shows current app/JAR versions in the headings
  • Adjusts the release workflow Maven build to pass -Drevision so packaged JARs carry the correct version

Technical notes: GitHub Releases are queried once and reused for both server JAR and Tauri manifest discovery; the updater command returns metadata plus a resource handle (rid) for JS-side update actions.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread app/tauri/src/App.tsx
}

serverAutoUpdateInFlightRef.current = true;
recordCheckAttempt();

@augmentcode augmentcode Bot Apr 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

app/tauri/src/App.tsx:226 recordCheckAttempt() runs after setting serverAutoUpdateInFlightRef.current = true; if localStorage.setItem throws (quota/disabled), the in-flight flag never resets and scheduled auto-updates can be skipped until restart. Consider ensuring the flag reset/scheduling is robust against storage exceptions.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread app/tauri/src/App.tsx
const update = await check();
const metadata = await invoke<TauriUpdateMetadata | null>("check_tauri_update");
const update = metadata ? new Update(metadata) : null;
updateRef.current = update;

@augmentcode augmentcode Bot Apr 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

app/tauri/src/App.tsx:428 updateRef.current is overwritten without closing any previously-held Update; with check_tauri_update storing updates in the Rust resources_table, repeated checks (or checking and not installing) can leak resources for the lifetime of the webview. Consider ensuring prior updates are close()d when replaced/abandoned.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

let _ = std::fs::remove_file(&backup_path);
}

std::fs::write(&version_path, format!("{}\n", release.version)).map_err(|e| e.to_string())?;

@augmentcode augmentcode Bot Apr 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

app/tauri/src-tauri/src/lib.rs:466 If persisting huntly-server.version fails after the JAR has already been swapped in, install_server_update returns an error even though the update itself succeeded, which can leave UI/state inconsistent. Consider whether failure to write the sidecar version should be treated as non-fatal or surfaced separately from install success.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

let version = tag_name.strip_prefix(TAURI_RELEASE_TAG_PREFIX)?;
let version_parts: Vec<&str> = version.split('.').collect();
if version_parts.len() < 3
|| !version_parts.iter().take(3).all(|part| {

@augmentcode augmentcode Bot Apr 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

app/tauri/src-tauri/src/lib.rs:538 tauri_release_version only checks that the first character of each of the first 3 dot-separated components is a digit, so tags like tauri/v1.2.3-rc1 would be treated as valid stable versions if the GitHub release isn't marked prerelease. That could cause latest.json selection to include unintended tags.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lcomplete lcomplete merged commit 13b6347 into main Apr 30, 2026
1 check passed
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.

1 participant