diff --git a/lib/upload-manager.js b/lib/upload-manager.js index a7178f9..2c4b4a5 100644 --- a/lib/upload-manager.js +++ b/lib/upload-manager.js @@ -688,6 +688,11 @@ class UploadManager extends EventEmitter { }); this.emit('account-failed', { hoster: task.hoster, accountId: task.accountId }); await this._sleep(800, signal); + // Re-check after the await: the user could have cancelled while + // we were waiting for main.js to resolve the fallback. Without + // this, rotation proceeds another full attempt-loop's worth of + // work before the next signal-check inside _executeUpload notices. + if (signal.aborted || this.stopAfterActive) break; } else { this._rotLog('already-marked', { jobId, hoster: task.hoster, fileName, accountId: task.accountId diff --git a/tasks/todo.md b/tasks/todo.md index 94ea3ec..4e7605c 100644 --- a/tasks/todo.md +++ b/tasks/todo.md @@ -16,11 +16,11 @@ - ✅ 3.3.12 — Race condition fix: `uploadManager = null` in batch-done clobberte einen frisch gespawnten Manager wenn user mid-await neuen batch startete (deep-audit finding HIGH-1) - ✅ 3.3.13 — `save-global-settings-sync` reportet jetzt `returnValue=false` bei Fehlern + debugLog statt silent swallow; TOCTOU bei .bak-Refresh in beiden Pfaden (main.js + lib/config-store.js _atomicWrite) entkoppelt: bak-Read-Failure failt nicht mehr den ganzen Save (deep-audit findings HIGH-2 + MED-4) - ✅ 3.3.14 — Parser-null-payload guard: `uploadFile` normalisiert payload zu `{}` falls `JSON.parse('null')` o.ä.; `parseDoodstreamResult` + `parseByseResult` haben defensive guards für direct callers + 7 neue Unit-Tests (null/non-object, malformed entries, fileRejected/accountError flips, valid filecode happy path) +- ✅ 3.3.15 — Cancellation latency fix: nach `_sleep(800)` in der rotation-while-loop wird `signal.aborted`/`stopAfterActive` re-checkt bevor das ganze override-resolution-Setup läuft (deep-audit MED-5) ## Open items (priorisiert) -### Stabilität (neu aus deep-audit) -- [ ] Cancellation latency in retry-loop's account-rotation block (lib/upload-manager.js:680-792) — re-check signal.aborted after each await. +(alle stabilitäts-items aus deep-audit erledigt) ### Code-Qualität (deferred) - [ ] removeFromQueueOnDone microtask-coalesce (3.3.1) — Microtask-Timing schwer zu testen ohne fake-timer setup