From d5ae38440d00b81361b89764c0715af0ea588a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Mon, 2 Nov 2026 20:10:29 +0500 Subject: [PATCH] fix(preview): resolve Tauri updater plugin config deserialization panic on launch --- src-tauri/tauri.conf.json | 8 ++++++++ src/lib/selfUpdate.ts | 26 ++++---------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index fa40e94..9915a26 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -37,5 +37,13 @@ "icons/icon.ico" ], "createUpdaterArtifacts": false + }, + "plugins": { + "updater": { + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDU4RERDQTRDMkQzQ0ZBRTIKUldUaStqd3RUTXJkV0VFU2t0ZUZ3Mm1XR2dNQ2grckZrYnlES0k3MHVnTWU5aDlXbmFqT3BjY1IK", + "endpoints": [ + "https://github.com/Corfirean/coa-server-manager/releases/latest/download/latest.json" + ] + } } } diff --git a/src/lib/selfUpdate.ts b/src/lib/selfUpdate.ts index e73bca6..6db6743 100644 --- a/src/lib/selfUpdate.ts +++ b/src/lib/selfUpdate.ts @@ -1,6 +1,6 @@ import { useSyncExternalStore } from "react"; import { getCurrentWindow } from "@tauri-apps/api/window"; -import { check, type Update } from "@tauri-apps/plugin-updater"; +import type { Update } from "@tauri-apps/plugin-updater"; import { relaunch } from "@tauri-apps/plugin-process"; /** @@ -44,27 +44,9 @@ export function setAutoUpdate(on: boolean) { listeners.forEach((l) => l()); } -/** Look for a new version. With `download` it also fetches the installer so it is ready to install on exit. */ -export async function lookForUpdate(opts: { download: boolean }): Promise { - if (state.phase === "checking" || state.phase === "downloading" || state.phase === "installing") return; - set({ phase: "checking", error: undefined, percent: null }); - try { - const u = await check(); - if (!u) { - update = null; - set({ phase: "current", version: undefined }); - return; - } - update = u; - set({ version: u.version, notes: u.body ?? undefined }); - if (!opts.download) { - set({ phase: "idle" }); - return; - } - await downloadPending(); - } catch (e) { - set({ phase: "error", error: String(e) }); - } +/** Look for a new version. Disabled in CSM Modules Preview to avoid overwriting with stable releases. */ +export async function lookForUpdate(_opts: { download: boolean }): Promise { + set({ phase: "current", version: undefined }); } async function downloadPending(): Promise {