From c828a6af47edd26e5a5fb157f00262188f6eaea8 Mon Sep 17 00:00:00 2001 From: MiTHRAL Date: Tue, 21 Apr 2026 15:50:23 -0400 Subject: [PATCH] fix: add notifications to all updater failure paths for diagnostics Co-Authored-By: Claude Sonnet 4.6 --- src/native/updater.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/native/updater.ts b/src/native/updater.ts index 78103a6..165d4c2 100644 --- a/src/native/updater.ts +++ b/src/native/updater.ts @@ -24,18 +24,32 @@ interface Release { export async function checkForUpdates() { try { + console.log("[updater] checking:", RELEASES_URL); + notify("Checking for Updates", "Looking for a new version of Sanctum…"); + const res = await fetch(RELEASES_URL); - if (!res.ok) return; + if (!res.ok) { + console.error("[updater] releases API returned", res.status, res.statusText); + notify("Update Check Failed", `API returned ${res.status} — check console.`); + return; + } const release = (await res.json()) as Release; const latest = release.tag_name.replace(/^v/, ""); const current = app.getVersion(); - if (!isNewer(latest, current)) return; + console.log(`[updater] current=${current} latest=${latest}`); + + if (!isNewer(latest, current)) { + notify("Already Up to Date", `You're on Sanctum ${current}.`); + return; + } const asset = findAsset(release.assets); if (!asset) { - console.error("[updater] no matching asset found for platform:", process.platform, release.assets.map(a => a.name)); + const names = release.assets.map(a => a.name).join(", "); + console.error("[updater] no matching asset for platform:", process.platform, names); + notify("Update Failed", `No ${process.platform} asset found. Assets: ${names}`); return; } @@ -44,6 +58,7 @@ export async function checkForUpdates() { await downloadAndInstall(asset.browser_download_url, latest); } catch (err) { console.error("[updater] update check failed:", err); + notify("Update Check Failed", String(err)); } }