From feed0fa8699261890dabcb76cc0f3536d2ede339 Mon Sep 17 00:00:00 2001 From: Kelorastus <108483685+Kelorastus@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:13:22 +0200 Subject: [PATCH] fix --- src-tauri/src/launcher.rs | 45 +++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src-tauri/src/launcher.rs b/src-tauri/src/launcher.rs index d8880db..41f0bd2 100644 --- a/src-tauri/src/launcher.rs +++ b/src-tauri/src/launcher.rs @@ -2292,23 +2292,40 @@ impl Launcher { .and_then(|m| m.get("source_commit").and_then(|c| c.as_str().map(str::to_string))), _ => None, }; - // The launcher's own feed is public, so this needs no token. + // The launcher's own feeds are public, so this needs no token. let mcp = self.inner.lock().await.settings.mcp_url.clone(); - let feed: Option = match mcp.is_empty() { - true => None, - false => match self - .http - .get(format!("{}/download/{LAUNCHER_FEED}", mcp.trim_end_matches('/'))) - .timeout(Duration::from_secs(10)) - .send() - .await - { - Ok(r) if r.status().is_success() => r.json::().await.ok(), - _ => None, - }, + let base = mcp.trim_end_matches('/').to_string(); + let get = |name: &str| { + let url = format!("{base}/download/{name}"); + let http = self.http.clone(); + let skip = mcp.is_empty(); + async move { + if skip { + return None; + } + match http.get(url).timeout(Duration::from_secs(10)).send().await { + Ok(r) if r.status().is_success() => r.json::().await.ok(), + _ => None, + } + } }; + let feed = get(LAUNCHER_FEED).await; let launcher_live = feed.as_ref().and_then(|f| f.get("version").and_then(|v| v.as_str().map(str::to_string))); - let launcher_commit = feed.as_ref().and_then(|f| f.get("source_commit").and_then(|v| v.as_str()).filter(|s| !s.is_empty()).map(str::to_string)); + // The commit is NOT in the updater feed and must not be put there: that document is + // Tauri's own format and goes out to every launcher in the field. `latest.json`, which + // this pipeline writes itself, carries it. Pair the two only when both name the same + // version - if they disagree, what is published is unknown and the row says so rather + // than claiming "up to date" and skipping a release that was needed. + let latest = get("latest.json").await; + let launcher_commit = match (&launcher_live, &latest) { + (Some(live), Some(l)) + if l.get("kind").and_then(|k| k.as_str()) == Some("launcher") + && l.get("version").and_then(|v| v.as_str()) == Some(live.as_str()) => + { + l.get("source_commit").and_then(|v| v.as_str()).filter(|s| !s.is_empty()).map(str::to_string) + } + _ => None, + }; crate::release::plan( &dev_root, &dev_root.join("ODIAN_MCP_Server"),