Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
fix(updater): stop offering updates to Intel Macs (#9490)
Akarshan Biswase9ee143266e0
diff --git a/.github/workflows/jan-tauri-build-nightly.yaml b/.github/workflows/jan-tauri-build-nightly.yamlindex da5bd1288..f4ac8bafa 100644--- a/.github/workflows/jan-tauri-build-nightly.yaml+++ b/.github/workflows/jan-tauri-build-nightly.yaml@@ -188,8 +188,6 @@ jobs:--arg windows_arm_url "$WINDOWS_ARM_URL" \--arg darwin_arm_signature "$DARWIN_SIGNATURE" \--arg darwin_arm_url "$DARWIN_URL" \- --arg darwin_amd_signature "$DARWIN_SIGNATURE" \- --arg darwin_amd_url "$DARWIN_URL" \'.version = $version| .pub_date = $pub_date| .platforms["linux-x86_64"].signature = $linux_signature@@ -201,9 +199,7 @@ jobs:| .platforms["windows-aarch64"].url = $windows_arm_urlend| .platforms["darwin-aarch64"].signature = $darwin_arm_signature- | .platforms["darwin-aarch64"].url = $darwin_arm_url- | .platforms["darwin-x86_64"].signature = $darwin_amd_signature- | .platforms["darwin-x86_64"].url = $darwin_amd_url' \+ | .platforms["darwin-aarch64"].url = $darwin_arm_url' \src-tauri/latest.json.template > latest.jsoncat latest.json- name: Sync temp to latestdiff --git a/.github/workflows/jan-tauri-build.yaml b/.github/workflows/jan-tauri-build.yamlindex 43feaf296..d61837c1f 100644--- a/.github/workflows/jan-tauri-build.yaml+++ b/.github/workflows/jan-tauri-build.yaml@@ -131,8 +131,6 @@ jobs:--arg windows_arm_url "$WINDOWS_ARM_URL" \--arg darwin_arm_signature "$DARWIN_SIGNATURE" \--arg darwin_arm_url "$DARWIN_URL" \- --arg darwin_amd_signature "$DARWIN_SIGNATURE" \- --arg darwin_amd_url "$DARWIN_URL" \'.version = $version| .pub_date = $pub_date| .platforms["linux-x86_64"].signature = $linux_signature@@ -144,9 +142,7 @@ jobs:| .platforms["windows-aarch64"].url = $windows_arm_urlend| .platforms["darwin-aarch64"].signature = $darwin_arm_signature- | .platforms["darwin-aarch64"].url = $darwin_arm_url- | .platforms["darwin-x86_64"].signature = $darwin_amd_signature- | .platforms["darwin-x86_64"].url = $darwin_amd_url' \+ | .platforms["darwin-aarch64"].url = $darwin_arm_url' \src-tauri/latest.json.template > latest.jsoncat latest.jsondiff --git a/scripts/check-update-feeds.mjs b/scripts/check-update-feeds.mjsindex 112b0f30a..9e5fd2ac9 100755--- a/scripts/check-update-feeds.mjs+++ b/scripts/check-update-feeds.mjs@@ -30,6 +30,11 @@ import { fileURLToPath } from 'node:url'const scriptDir = dirname(fileURLToPath(import.meta.url))const fixturesDir = join(scriptDir, 'fixtures', 'update-feeds')+// Platforms the feed must NOT list. Intel Macs are unsupported (the engine is+// Apple Silicon only), and the updater offers a release to any platform the+// feed lists, so a stray entry moves them onto a build that cannot run models.+const forbiddenPlatforms = ['darwin-x86_64']+const FEEDS = [{name: 'stable',@@ -37,7 +42,7 @@ const FEEDS = [live: 'https://apps.jan.ai/update-check',// windows-aarch64 is deliberately absent today; shipping a stable arm64// build must consciously extend this set.- requiredPlatforms: ['darwin-aarch64', 'darwin-x86_64', 'windows-x86_64', 'linux-x86_64'],+ requiredPlatforms: ['darwin-aarch64', 'windows-x86_64', 'linux-x86_64'],},{name: 'nightly',@@ -45,7 +50,6 @@ const FEEDS = [live: 'https://delta.jan.ai/nightly/latest.json',requiredPlatforms: ['darwin-aarch64',- 'darwin-x86_64','windows-x86_64','windows-aarch64','linux-x86_64',@@ -116,6 +120,11 @@ function checkFeed(feed, body) {fail(`${feed.name}: ${required} signature missing or implausibly short`)}}+ for (const key of Object.keys(platforms)) {+ // Also catches installer-qualified keys such as `darwin-x86_64-app`.+ const hit = forbiddenPlatforms.find((p) => key === p || key.startsWith(`${p}-`))+ if (hit) fail(`${feed.name}: unsupported platform "${key}" must not be in the manifest`)+ }}// Live-only: every advertised asset must actually resolve. A 404 here is thediff --git a/scripts/fixtures/update-feeds/nightly.json b/scripts/fixtures/update-feeds/nightly.jsonindex 2d24e2ce2..295d5a94d 100644--- a/scripts/fixtures/update-feeds/nightly.json+++ b/scripts/fixtures/update-feeds/nightly.json@@ -15,10 +15,6 @@"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTHVFczR5MlVlTjRMQ2l5bGRBdkgwTG1mRTIvbXpBOHc1RW1ITHkrZXd1bFpJRldMbDhWYTBER1RBWTZmMVR4czFadWhsUGRuTlJoeWFQREk0OEpFV1FZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg5NTkyNDI2CWZpbGU6SmFuLW5pZ2h0bHkuYXBwLnRhci5nego4RkUwWEFTQ0dWazVqQW9GeW5oQmlMQ211di9qUkR6Vzhic2dLZWh5MDRUNm8xVFVVKzJzNlZwQXFRUnp1dUtGcUdWVWc5WUxWcElaWjF4QWVDK0pCZz09Cg==","url": "https://delta.jan.ai/nightly/Jan-nightly_0.8.4-4980.app.tar.gz"},- "darwin-x86_64": {- "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTHVFczR5MlVlTjRMQ2l5bGRBdkgwTG1mRTIvbXpBOHc1RW1ITHkrZXd1bFpJRldMbDhWYTBER1RBWTZmMVR4czFadWhsUGRuTlJoeWFQREk0OEpFV1FZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg5NTkyNDI2CWZpbGU6SmFuLW5pZ2h0bHkuYXBwLnRhci5nego4RkUwWEFTQ0dWazVqQW9GeW5oQmlMQ211di9qUkR6Vzhic2dLZWh5MDRUNm8xVFVVKzJzNlZwQXFRUnp1dUtGcUdWVWc5WUxWcElaWjF4QWVDK0pCZz09Cg==",- "url": "https://delta.jan.ai/nightly/Jan-nightly_0.8.4-4980.app.tar.gz"- },"windows-aarch64": {"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGdiQWt2VjlZK0wvSXN2ZDlTNythZHZCaUh4THJsRTE3TlpRNEI1UEVRT29wbWNnRkRGSjZSaEFEalYwdDdhSnBWRXk2VWhSMVJ3azdrdjVwYzJTSVFjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg5NTkxMjE3CWZpbGU6SmFuLW5pZ2h0bHlfMC44LjQtNDk4MF9hcm02NC1zZXR1cC5leGUKckEyTEZvVTMyeWViTzFZKzJETko1TncyNFV3dHgxT205eXVPanBvc2lGcmFVbzBQdDk0a2hkZGdpaDFHVm1EYTdRbDJRSTQwdXpEUVUzRTRMSjhsQWc9PQo=","url": "https://delta.jan.ai/nightly/Jan-nightly_0.8.4-4980_arm64-setup.exe"diff --git a/scripts/fixtures/update-feeds/stable.json b/scripts/fixtures/update-feeds/stable.jsonindex fbf4422e8..4c278b4a0 100644--- a/scripts/fixtures/update-feeds/stable.json+++ b/scripts/fixtures/update-feeds/stable.json@@ -1 +1 @@-{"version":"0.8.4","notes":"","pub_date":"2026-07-23T02:38:33.259Z","platforms":{"linux-x86_64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGpnQTJFTzZweVF3Tm9iS0ljcHVHYkU4RVYvK3E5Ujk1YlhUbHhBWWdDQkVEeWdsRllkdmNjWGZmeGpLVTdZSmlRV3BNSUZaSmZVZlA0djlCVmRJdVEwPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0NzczMzcwCWZpbGU6SmFuXzAuOC40X2FtZDY0LkFwcEltYWdlClhPOUJ3cDRpMG1VckZ0UmRUYUhtUjZEaytaaWFzNS8wYlJVSXNoWS8vdjVCTVBWUDZsNCsvdm1JVUxTLzFZbE1sbTVDVDB6YkZlTUwwVDNrZGlLSERRPT0K","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan_0.8.4_amd64.AppImage"},"windows-x86_64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGh4SVJRYU83dlNibnZvS1g4Sm83UWM0UTdndmd1OSt4ZHFPNW13V1lZTjd1UEVNRXorMDN3NkpwRHZMNXhsUTkyR1ZEVml0MHFRWHJKMXA0dzNUZ2dVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0Nzc0MDIyCWZpbGU6SmFuXzAuOC40X3g2NC1zZXR1cC5leGUKOERYeERBVFRYUVdlamJwRlRFRXcxRnI1WjdhbkVYbUN5YmVFaE42di91d0pMdFZObkdWdHp4cTdsK0Uzdm9WODdlY1VBR25tTG5vS3VQbmlOKzdDREE9PQo=","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan_0.8.4_x64-setup.exe"},"darwin-aarch64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGg0ajNReDd1aWpkekxTZHR6ZHFWU1ZpZ1d5T2xyenc2VTVuRFhzYWt4NXR6OVdmb1FZZEt6TWEvUDJYT0ZlYzBYd0hTWXpUREMvUGdaS0FCOGVOandrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0Nzc0MjcwCWZpbGU6SmFuLmFwcC50YXIuZ3oKQU91V0diblJXdmdxTkFLN0RSNUl6NHRmdjlKNzlxNXQzOEpOeE1TdjkxYUJlb1p4SVUwVDdJOVRtYXVZTTFtandlMmVsSmNOczBuSTJMUytjRUwwQ1E9PQo=","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan.app.tar.gz"},"darwin-x86_64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGg0ajNReDd1aWpkekxTZHR6ZHFWU1ZpZ1d5T2xyenc2VTVuRFhzYWt4NXR6OVdmb1FZZEt6TWEvUDJYT0ZlYzBYd0hTWXpUREMvUGdaS0FCOGVOandrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0Nzc0MjcwCWZpbGU6SmFuLmFwcC50YXIuZ3oKQU91V0diblJXdmdxTkFLN0RSNUl6NHRmdjlKNzlxNXQzOEpOeE1TdjkxYUJlb1p4SVUwVDdJOVRtYXVZTTFtandlMmVsSmNOczBuSTJMUytjRUwwQ1E9PQo=","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan.app.tar.gz"}}}\ No newline at end of file+{"version":"0.8.4","notes":"","pub_date":"2026-07-23T02:38:33.259Z","platforms":{"linux-x86_64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGpnQTJFTzZweVF3Tm9iS0ljcHVHYkU4RVYvK3E5Ujk1YlhUbHhBWWdDQkVEeWdsRllkdmNjWGZmeGpLVTdZSmlRV3BNSUZaSmZVZlA0djlCVmRJdVEwPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0NzczMzcwCWZpbGU6SmFuXzAuOC40X2FtZDY0LkFwcEltYWdlClhPOUJ3cDRpMG1VckZ0UmRUYUhtUjZEaytaaWFzNS8wYlJVSXNoWS8vdjVCTVBWUDZsNCsvdm1JVUxTLzFZbE1sbTVDVDB6YkZlTUwwVDNrZGlLSERRPT0K","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan_0.8.4_amd64.AppImage"},"windows-x86_64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGh4SVJRYU83dlNibnZvS1g4Sm83UWM0UTdndmd1OSt4ZHFPNW13V1lZTjd1UEVNRXorMDN3NkpwRHZMNXhsUTkyR1ZEVml0MHFRWHJKMXA0dzNUZ2dVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0Nzc0MDIyCWZpbGU6SmFuXzAuOC40X3g2NC1zZXR1cC5leGUKOERYeERBVFRYUVdlamJwRlRFRXcxRnI1WjdhbkVYbUN5YmVFaE42di91d0pMdFZObkdWdHp4cTdsK0Uzdm9WODdlY1VBR25tTG5vS3VQbmlOKzdDREE9PQo=","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan_0.8.4_x64-setup.exe"},"darwin-aarch64":{"signature":"dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRXJUVWE2ekJCTGg0ajNReDd1aWpkekxTZHR6ZHFWU1ZpZ1d5T2xyenc2VTVuRFhzYWt4NXR6OVdmb1FZZEt6TWEvUDJYT0ZlYzBYd0hTWXpUREMvUGdaS0FCOGVOandrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzg0Nzc0MjcwCWZpbGU6SmFuLmFwcC50YXIuZ3oKQU91V0diblJXdmdxTkFLN0RSNUl6NHRmdjlKNzlxNXQzOEpOeE1TdjkxYUJlb1p4SVUwVDdJOVRtYXVZTTFtandlMmVsSmNOczBuSTJMUytjRUwwQ1E9PQo=","url":"https://github.com/janhq/jan/releases/download/v0.8.4/Jan.app.tar.gz"}}}\ No newline at end of filediff --git a/src-tauri/latest.json.template b/src-tauri/latest.json.templateindex 50a570c9e..2655b9198 100644--- a/src-tauri/latest.json.template+++ b/src-tauri/latest.json.template@@ -14,10 +14,6 @@"darwin-aarch64": {"signature": "","url": ""- },- "darwin-x86_64": {- "signature": "",- "url": ""}}}\ No newline at end of filediff --git a/src-tauri/src/core/updater/commands.rs b/src-tauri/src/core/updater/commands.rsindex 017d9d10e..63418516c 100644--- a/src-tauri/src/core/updater/commands.rs+++ b/src-tauri/src/core/updater/commands.rs@@ -30,6 +30,19 @@ pub async fn check_for_app_updates(// Only return update info if the version is actually newerif let Some(ref info) = update_info {+ // The feed leaves out platforms Jan no longer supports (Intel Macs).+ // Offering the version anyway would show the update dialog and then+ // fail the download, since tauri-plugin-updater picks the asset by+ // the same platform key and returns TargetNotFound.+ let target = tauri_plugin_updater::target();+ if !feed_serves_target(info.platforms.as_ref(), target.as_deref()) {+ log::info!(+ "No update for this platform: {} is not in the feed for {}",+ target.as_deref().unwrap_or("unknown"),+ info.version+ );+ return Ok(None);+ }if updater.is_update_available(¤t_version, &info.version) {log::info!("Update available: current {} -> latest {}",@@ -50,6 +63,22 @@ pub async fn check_for_app_updates(Ok(None)}+/// Whether a feed's `platforms` map has an asset for `target` (`{os}-{arch}`),+/// under the same keys tauri-plugin-updater looks up: `{os}-{arch}` or+/// `{os}-{arch}-{installer}`. A feed without `platforms` (the server format)+/// or an unknown target is left to the version check, as before.+fn feed_serves_target(platforms: Option<&serde_json::Value>, target: Option<&str>) -> bool {+ let (Some(platforms), Some(target)) = (platforms.and_then(|p| p.as_object()), target) else {+ return true;+ };+ platforms.keys().any(|key| {+ key == target+ || key+ .strip_prefix(target)+ .is_some_and(|rest| rest.starts_with('-'))+ })+}+/// Get updater endpoints from tauri configfn get_updater_endpoints(app: &AppHandle) -> Vec<String> {// Try to get endpoints from tauri config@@ -80,3 +109,48 @@ pub fn is_update_available(current_version: String, latest_version: String) -> b};updater.is_update_available(¤t_version, &latest_version)}++#[cfg(test)]+mod tests {+ use super::*;+ use serde_json::json;++ fn entry() -> serde_json::Value {+ json!({ "url": "https://example.com/Jan.app.tar.gz", "signature": "sig" })+ }++ #[test]+ fn static_feed_without_this_target_is_not_an_update() {+ let platforms = json!({ "darwin-aarch64": entry(), "linux-x86_64": entry() });+ assert!(!feed_serves_target(Some(&platforms), Some("darwin-x86_64")));+ }++ #[test]+ fn static_feed_with_this_target_is_an_update() {+ let platforms = json!({ "darwin-aarch64": entry(), "darwin-x86_64": entry() });+ assert!(feed_serves_target(Some(&platforms), Some("darwin-x86_64")));+ }++ #[test]+ fn installer_qualified_key_serves_its_target() {+ let platforms = json!({ "darwin-x86_64-app": entry() });+ assert!(feed_serves_target(Some(&platforms), Some("darwin-x86_64")));+ }++ #[test]+ fn similar_prefix_does_not_serve_target() {+ let platforms = json!({ "darwin-x86_64h": entry() });+ assert!(!feed_serves_target(Some(&platforms), Some("darwin-x86_64")));+ }++ #[test]+ fn dynamic_feed_without_platforms_is_left_to_the_version_check() {+ assert!(feed_serves_target(None, Some("darwin-x86_64")));+ }++ #[test]+ fn unknown_target_is_left_to_the_version_check() {+ let platforms = json!({ "darwin-aarch64": entry() });+ assert!(feed_serves_target(Some(&platforms), None));+ }+}