From c1f8d2a14d7f6854d3a472b2cd9ecd65fe0a182d Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Wed, 25 Mar 2026 01:42:20 -0400 Subject: [PATCH] fix: read version from tauri.conf.json, not CARGO_PKG_VERSION CARGO_PKG_VERSION is always 0.1.0 (hardcoded in Cargo.toml). CI patches tauri.conf.json from the git tag. Now reads app_handle.config() for the real version so the update checker compares correctly. Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/src/commands/updater.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/commands/updater.rs b/src-tauri/src/commands/updater.rs index c38d32b..2eba46b 100644 --- a/src-tauri/src/commands/updater.rs +++ b/src-tauri/src/commands/updater.rs @@ -14,8 +14,10 @@ pub struct UpdateInfo { /// Check Gitea for the latest release and compare with current version. #[tauri::command] -pub async fn check_for_updates() -> Result { - let current = env!("CARGO_PKG_VERSION").to_string(); +pub async fn check_for_updates(app_handle: tauri::AppHandle) -> Result { + // Read version from tauri.conf.json (patched by CI from git tag) + // rather than CARGO_PKG_VERSION which is always 0.1.0 + let current = app_handle.config().version.clone().unwrap_or_else(|| "0.0.0".to_string()); let client = reqwest::Client::builder() .timeout(std::time::Duration::from_secs(10))