fix(update): verify and apply the actual latest version

This commit is contained in:
Sucukdeluxe
2026-08-21 07:39:37 +02:00
parent 4cebc6fefd
commit 6efdca6885
10 changed files with 154 additions and 41 deletions
+7 -11
View File
@@ -895,17 +895,13 @@ export class AppController {
this.lastUpdateCheckAt = Date.now();
}
return result;
}
public async installUpdate(onProgress?: (progress: UpdateInstallProgress) => void): Promise<UpdateInstallResult> {
const cacheAgeMs = Date.now() - this.lastUpdateCheckAt;
const cached = this.lastUpdateCheck && !this.lastUpdateCheck.error && cacheAgeMs <= 10 * 60 * 1000
? this.lastUpdateCheck
: undefined;
const result = await runInstallWithResume(
this.manager,
() => installLatestUpdate(this.settings.updateRepo, cached, onProgress)
);
}
public async installUpdate(onProgress?: (progress: UpdateInstallProgress) => void): Promise<UpdateInstallResult> {
const result = await runInstallWithResume(
this.manager,
() => installLatestUpdate(this.settings.updateRepo, undefined, onProgress)
);
if (result.started) {
this.lastUpdateCheck = null;
this.lastUpdateCheckAt = 0;