fix: gate startup reconcile on renderer readiness
Defer the productive FolderMonitor startup scan until the renderer has registered its candidate listener and acknowledged readiness. Keep the handshake idempotent across duplicate signals, reloads, window closure, shutdown, paused startup, and renderer initialization failure without delaying unrelated startup work. Preserve the real over-limit queue count while clamping finite progressbar ARIA values, and cover both regressions with hidden Electron and preload ordering tests.
This commit is contained in:
+2
-1
@@ -940,7 +940,7 @@ function renderAutomationStatusSnapshot(snapshot) {
|
||||
queueTrack.removeAttribute('aria-valuenow');
|
||||
queueTrack.removeAttribute('aria-valuemax');
|
||||
} else {
|
||||
queueTrack.setAttribute('aria-valuenow', String(snapshot.currentJobCount));
|
||||
queueTrack.setAttribute('aria-valuenow', String(Math.min(snapshot.currentJobCount, snapshot.queueLimitJobs)));
|
||||
queueTrack.setAttribute('aria-valuemax', String(snapshot.queueLimitJobs));
|
||||
}
|
||||
queueTrack.setAttribute('aria-valuetext', queueText);
|
||||
@@ -1343,6 +1343,7 @@ async function init() {
|
||||
window.api.onFolderMonitorNewFiles(files => {
|
||||
handleFolderMonitorFiles(files).catch(error => window.api.debugLog(`folder-monitor renderer evaluation failed: ${error.message || String(error)}`));
|
||||
});
|
||||
window.api.signalFolderMonitorReady();
|
||||
if (typeof window.api.onAutomationStatus === 'function') {
|
||||
window.api.onAutomationStatus(status => {
|
||||
applyAutomationRuntimeStatus(status);
|
||||
|
||||
Reference in New Issue
Block a user