updated debug

This commit is contained in:
2026-10-30 20:02:41 -07:00
parent b201510b5a
commit 609891f478
4 changed files with 209 additions and 27 deletions

View File

@@ -84,6 +84,7 @@ function getReplacementsConfig() {
const updateClient = new UpdateClient(APPDATA_DIR);
const fileUpdater = new FileUpdater(APPDATA_DIR, updateClient);
fileUpdater.onNotice = (message) => sendToTauri('notice', { message });
let lastFilePercent = -1;
fileUpdater.onProgress = (downloaded, total) => {
const percent = total > 0 ? Math.round((downloaded / total) * 100) : 0;
@@ -222,7 +223,7 @@ async function start() {
debugLog(`Update check finished. Found: ${release ? release.version : 'None'}`);
} catch (e) {
debugLog(`Update check failed (offline?): ${e.message}`);
sendToTauri('status', { message: `Update server check skipped (${e.message})` });
sendToTauri('notice', { message: `Update check skipped: ${e.message}` });
}
const normalizeVer = (v) => (v || '').toString().replace(/^v/, '').trim();
@@ -293,10 +294,12 @@ async function start() {
const [filesCheck, sdkCheck] = await Promise.all([
withTimeout(fileUpdater.checkRepos().catch((e) => {
debugLog(`Live file check failed: ${e.message}`);
sendToTauri('notice', { message: `File check failed: ${e.message}` });
return null;
}), 60000),
}), 240000),
withTimeout(fileUpdater.checkSdk().catch((e) => {
debugLog(`SDK check failed: ${e.message}`);
sendToTauri('notice', { message: `SDK check failed: ${e.message}` });
return null;
}), 12000)
]);
@@ -311,7 +314,7 @@ async function start() {
sendToTauri('status', { message: `Updated ${filesCheck.changes.length} file(s).` });
} catch (e) {
debugLog(`File update failed: ${e.message}`);
sendToTauri('status', { message: `File update failed: ${e.message}` });
sendToTauri('notice', { message: `File update failed: ${e.message}` });
}
}