fix: update checker uses Gitea releases API instead of Tauri updater
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 3m53s

The Tauri native updater needs update.json hosted at a static URL.
Gitea packages don't support a 'latest' alias, so the endpoint
returned 'package does not exist'. Reverted Settings and startup
check to use check_for_updates command which queries the Gitea
releases API directly and works reliably.

The native auto-updater will work once we have proper static hosting
for update.json (or a redirect endpoint). For now, the manual check
+ download page approach is functional.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell 2026-03-26 15:16:42 -04:00
parent 9f6085d251
commit be76a61119
2 changed files with 12 additions and 38 deletions

View File

@ -320,25 +320,7 @@ async function checkUpdates(): Promise<void> {
updateChecking.value = true; updateChecking.value = true;
updateInfo.value = null; updateInfo.value = null;
try { try {
const { check } = await import("@tauri-apps/plugin-updater"); updateInfo.value = await invoke<UpdateCheckInfo>("check_for_updates");
const update = await check();
if (update?.available) {
updateInfo.value = {
currentVersion: await getVersion(),
latestVersion: update.version || "unknown",
updateAvailable: true,
downloadUrl: "",
releaseNotes: update.body || "",
};
} else {
updateInfo.value = {
currentVersion: await getVersion(),
latestVersion: await getVersion(),
updateAvailable: false,
downloadUrl: "",
releaseNotes: "",
};
}
} catch (err) { } catch (err) {
alert(`Update check failed: ${err}`); alert(`Update check failed: ${err}`);
} }
@ -346,16 +328,11 @@ async function checkUpdates(): Promise<void> {
} }
async function downloadUpdate(): Promise<void> { async function downloadUpdate(): Promise<void> {
if (!updateInfo.value?.downloadUrl) return;
try { try {
const { check } = await import("@tauri-apps/plugin-updater"); await shellOpen(updateInfo.value.downloadUrl);
const update = await check(); } catch {
if (update?.available) { window.open(updateInfo.value.downloadUrl, "_blank");
await update.downloadAndInstall();
const { relaunch } = await import("@tauri-apps/plugin-process");
await relaunch();
}
} catch (err) {
alert(`Update failed: ${err}`);
} }
} }
const currentVersion = ref("loading..."); const currentVersion = ref("loading...");

View File

@ -536,18 +536,15 @@ onMounted(async () => {
} catch {} } catch {}
// Check for updates on startup via Tauri updater plugin (non-blocking) // Check for updates on startup via Tauri updater plugin (non-blocking)
import("@tauri-apps/plugin-updater").then(async ({ check }) => { invoke<{ currentVersion: string; latestVersion: string; updateAvailable: boolean; downloadUrl: string }>("check_for_updates")
try { .then((info) => {
const update = await check(); if (info.updateAvailable) {
if (update?.available) { if (confirm(`Wraith v${info.latestVersion} is available (you have v${info.currentVersion}). Open download page?`)) {
if (confirm(`Wraith v${update.version} is available. Download and install?`)) { import("@tauri-apps/plugin-shell").then(({ open }) => open(info.downloadUrl)).catch(() => window.open(info.downloadUrl, "_blank"));
await update.downloadAndInstall();
const { relaunch } = await import("@tauri-apps/plugin-process");
await relaunch();
} }
} }
} catch {} })
}).catch(() => {}); .catch(() => {});
}); });
onUnmounted(() => { onUnmounted(() => {