fixed an extreme ammount of issues

This commit is contained in:
2026-10-30 19:01:30 -07:00
parent 08950e101f
commit aaa0df5f17
8 changed files with 117 additions and 62 deletions

17
main.js
View File

@@ -242,7 +242,7 @@ async function start() {
const versionNewer = isNewer(release.version, localVersion);
const sameVerNewBuild = normalizeVer(release.version) === normalizeVer(localVersion) &&
!!release.sha256 && !!localSha && release.sha256 !== localSha;
const hasUpdate = versionNewer;
const hasUpdate = versionNewer || sameVerNewBuild;
if (isFirstRun) {
debugLog("First run with no local payload. Installing remote build...");
@@ -269,12 +269,14 @@ async function start() {
patcher.bridgeCredentials(serviceManager.credentialManager);
let ver = "1.0.0";
let manSha = null;
try {
const man = JSON.parse(fs.readFileSync(path.join(__dirname, 'manifest.json'), 'utf8'));
ver = man.version || ver;
manSha = man.sha256 || null;
} catch (e) { }
patcher.saveCurrentVersion(ver);
patcher.saveCurrentVersion(ver, manSha);
serviceManager.envConfig = getEnvConfig();
debugLog("Local payload extracted successfully.");
} else {
@@ -289,20 +291,21 @@ async function start() {
sendToTauri('status', { message: 'Checking UI files and SDK...' });
const [filesCheck, sdkCheck] = await Promise.all([
withTimeout(fileUpdater.checkFiles().catch((e) => {
debugLog(`File check failed: ${e.message}`);
withTimeout(fileUpdater.checkRepos().catch((e) => {
debugLog(`Live file check failed: ${e.message}`);
return null;
}), 180000),
}), 60000),
withTimeout(fileUpdater.checkSdk().catch((e) => {
debugLog(`SDK check failed: ${e.message}`);
return null;
}), 12000)
]);
debugLog(`Repo check result: ${filesCheck ? `${filesCheck.changes.length} change(s)` : 'failed or timed out'}`);
if (filesCheck && filesCheck.changes.length > 0) {
if (filesCheck && (filesCheck.changes.length > 0 || filesCheck.removed.length > 0)) {
sendToTauri('status', { message: `Updating ${filesCheck.changes.length} file(s)...` });
try {
await fileUpdater.applyFiles(filesCheck.changes, filesCheck.seq, getReplacementsConfig(), (file, done, total) => {
await fileUpdater.applyLive(filesCheck, getReplacementsConfig(), (file, done, total) => {
sendToTauri('extract-progress', { file, done, total, percent: Math.round((done / total) * 100) });
});
sendToTauri('status', { message: `Updated ${filesCheck.changes.length} file(s).` });