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

View File

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