fix: stabilize renderer state and lifecycle updates

Prevent stale history, account, diagnostics, and language updates from repainting newer state. Keep queue virtualization, panel sizing, telemetry, cancellation, and runtime timing consistent across rapid UI changes. Strengthen painted-frame and lifecycle regression coverage, and brand packaged Windows metadata with the product publisher.
This commit is contained in:
Sucukdeluxe
2026-08-13 07:07:42 +02:00
parent b7754f355b
commit 59cead80c6
13 changed files with 747 additions and 50 deletions
+10 -7
View File
@@ -406,8 +406,9 @@ class UploadManager extends EventEmitter {
await Promise.allSettled(batch);
}
this._stopStatsTimer();
this.running = false;
this._stopStatsTimer();
this._emitStats();
const files = Array.from(results.values());
const total = tasks.length;
@@ -1291,8 +1292,11 @@ class UploadManager extends EventEmitter {
_startStatsTimer() {
if (this.statsInterval) clearInterval(this.statsInterval);
this.statsInterval = setInterval(() => {
try {
this.statsInterval = setInterval(() => this._emitStats(), 1000);
}
_emitStats() {
try {
let globalSpeedKbs = 0;
let activeCount = 0;
let inProgressBytes = 0;
@@ -1312,8 +1316,7 @@ class UploadManager extends EventEmitter {
activeJobs: activeCount,
pendingJobs: Object.values(this.semaphores).reduce((sum, semaphore) => sum + semaphore.pending, 0)
});
} catch { /* never let a stats tick crash the timer + caller */ }
}, 1000);
} catch {}
}
_stopStatsTimer() {
@@ -1454,12 +1457,12 @@ class UploadManager extends EventEmitter {
cancel() {
if (!this.running) return;
this.abortController.abort();
this.stopAfterActive = false;
this.running = false;
this.stopAfterActive = true;
for (const controller of this.jobAbortControllers.values()) {
if (!controller.signal.aborted) controller.abort();
}
this._stopStatsTimer();
this._emitStats();
}
}