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:
@@ -4,6 +4,10 @@ function configureStartupRenderer(app, env = process.env, platform = process.pla
|
||||
return app;
|
||||
}
|
||||
|
||||
function resolveStartupLanguage(config) {
|
||||
return config && config.globalSettings && config.globalSettings.language === 'de' ? 'de' : 'en';
|
||||
}
|
||||
|
||||
function createStartupWindow(BrowserWindow, options) {
|
||||
const window = new BrowserWindow({ ...options, show: false });
|
||||
window.once('ready-to-show', () => {
|
||||
@@ -12,10 +16,10 @@ function createStartupWindow(BrowserWindow, options) {
|
||||
|
||||
return {
|
||||
window,
|
||||
load(target, onLoadError) {
|
||||
return window.loadFile(target).catch(onLoadError);
|
||||
load(target, onLoadError, options) {
|
||||
return window.loadFile(target, options).catch(onLoadError);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = { configureStartupRenderer, createStartupWindow };
|
||||
module.exports = { configureStartupRenderer, createStartupWindow, resolveStartupLanguage };
|
||||
|
||||
+10
-7
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user