The microtask-coalesce path from 3.3.1 (queueMicrotask + Set so 500
finishing jobs become one queueJobs.filter pass instead of 500) lived
inline in renderer/app.js. Pulled out into lib/coalesced-set.js with
an injectable scheduler so a Node test can drive timing without
async waits.
API: makeCoalescedSet({ apply, scheduler? }) returns
add(id) — queue an id for the next batch
drainSync() — flush synchronously (used by beforeunload)
pendingSize() — diagnostics
isScheduled() — diagnostics
Renderer rewires the previous _pendingDoneRemovalIds + manual
queueMicrotask plumbing to the new helper. Optional-chained: if the
script fails to load, a slower per-event filter runs as fallback.
Coverage:
- multiple adds same tick → 1 apply, all ids deduped
- duplicate ids deduped
- batches between flushes stay independent
- add after flush re-schedules
- drainSync flushes synchronously, queued microtask becomes a no-op
- empty drainSync is a no-op
- throwing apply doesn't lock out subsequent batches
- default scheduler (queueMicrotask) runs eventually
- 5000-id burst still coalesces to 1 apply
137/137 green.
52 lines
4.9 KiB
Markdown
52 lines
4.9 KiB
Markdown
# Verbesserungs-Loop — open items
|
|
|
|
## Released
|
|
- ✅ 3.3.0 — Performance-Fixes (queue-cap, sort-throttle, history-delegation, recent-cap) + Log-Recovery
|
|
- ✅ 3.3.1 — `removeFromQueueOnDone` coalesced via microtask (kein O(N²) mehr bei done-Bursts)
|
|
- ✅ 3.3.2 — `fileuploader.log` Auto-Rotation bei 50 MB (max 3 Backups: .1 .2 .3)
|
|
- ✅ 3.3.3 — `_jobLogCollector` Cap auf 1000 tracked jobs (FIFO-eviction beim Überschreiten)
|
|
- ✅ 3.3.4 — `applyQueueSelectionClasses` + `applyRecentSelectionClasses` nutzen `getElementsByClassName` (live HTMLCollection statt querySelectorAll re-query bei jedem Klick)
|
|
- ✅ 3.3.5 — Log-Rotation extrahiert nach `lib/log-rotation.js` + 10 neue Unit-Tests (cap, shift, eviction, idempotency, maxBackups=1, invalid input, no-extension)
|
|
- ✅ 3.3.6 — CSS `.queue-row` transition nur noch auf `:hover` (kein 150ms compositor-tween bei status-flips)
|
|
- ✅ 3.3.7 — `_sessionTrackedJobs`/`_sessionDoneJobs` werden bei handleBatchDone gegen current queueJobs geprunt (no more unbounded session memory growth across batches)
|
|
- ✅ 3.3.8 — queue-cap-prune-Logik nach `lib/queue-prune.js` extrahiert (dual-environment: Node + Browser-global) + 10 Unit-Tests (insertion-order, limit=0, malformed entries, large-queue 5000-job sweep)
|
|
- ✅ 3.3.9 — Throttled-Cache nach `lib/throttled-cache.js` extrahiert (von sortQueueJobs dynamic-throttle genutzt) + 12 Unit-Tests (TTL-Boundary, identity-tracking, fake-clock, peek/clear, refreshMs=0, large-input)
|
|
- ✅ 3.3.10 — `npm audit fix` (non-breaking): 4 vulnerabilities geschlossen (16 → 12), nur Lock-file Update
|
|
- ✅ 3.3.11 — Patch-Bumps `eslint 10.1→10.2`, `undici 7.24→7.25`, `ws 8.19→8.20` (semver-compatible)
|
|
- ✅ 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)
|
|
- ✅ 3.3.16 — Auto-Rotation für die anderen 3 internen Logs (`upload-debug.log` 25 MB, `account-rotation.log` 10 MB, `doodstream-debug.log` 10 MB), je 2 Backups — alle nutzen `lib/log-rotation.js` (zuvor nur `fileuploader.log` rotiert)
|
|
- ✅ 3.3.17 — `npm audit fix --force` (User authorized): `electron-builder 25 → 26`, `electron 33 → 41`, alle 12 verbleibenden Vulns geschlossen (12 → 0). Build verifiziert (NSIS+portable laufen mit electron 41), 126/126 grün.
|
|
- ✅ 3.3.18 — Microtask-Coalescer extrahiert nach `lib/coalesced-set.js` mit injectable scheduler (für Tests) + 11 Unit-Tests (single/multi-add coalesce, dedup, sequential batches, drainSync vs scheduler-noop, throwing-apply-recovery, 5000-burst). 137/137 grün.
|
|
|
|
## Open items (priorisiert)
|
|
|
|
(alle stabilitäts-items aus deep-audit erledigt)
|
|
|
|
### Code-Qualität
|
|
(alle erledigt)
|
|
|
|
### Loop-Status
|
|
Alle initial im 3.3.0-Audit identifizierten Items sind nun adressiert. Beide verbliebenen open items sind explizit deferred (microtask-fake-timer-Setup ist Refactor, audit-fix --force ist Major-Bump und braucht User-OK).
|
|
|
|
**Iteration 11 + 18 (skipped, no release)**: kein nicht-deferred Item übrig. Loop läuft idle weiter — bei nächstem Cron-Tick prüft er erneut, falls inzwischen neue Issues aufgetaucht sind.
|
|
|
|
**Bilanz nach 16 produktiven Releases (3.3.0 → 3.3.16)**:
|
|
- 8 Stabilitäts-Fixes (race conditions, error swallowing, parser crashes, cancellation latency, log rotation, queue session-memory)
|
|
- 5 Performance-Fixes (queue-cap, sort-throttle, history-delegation, recent-cap, removeFromQueueOnDone coalesce)
|
|
- 4 Test-Coverage-Erweiterungen (+39 Unit-Tests: 87 → 126)
|
|
- 3 Code-Quality-Bumps (CSS-scope, npm-audit-fix, dep patches)
|
|
- 3 Modul-Extractions (log-rotation, queue-prune, throttled-cache)
|
|
|
|
Sinnvolle nächste Schritte für den User:
|
|
- "Loop stop" wenn nichts mehr passieren soll (CronDelete `01e33ae1`)
|
|
- "Major bump genehmigt" für `npm audit fix --force` (closes 12 deferred vulns, bumpt electron-builder@26)
|
|
- Neue konkrete User-Beschwerden / Bug-Reports
|
|
- Manuelle Anweisung was als nächstes interessant wäre
|
|
|
|
## Loop-Notes
|
|
- Cron-Job `01e33ae1` läuft alle 30min (:07/:37), Session-only.
|
|
- Pro Iteration: GENAU EIN Issue. Auto-Release bei grünen Tests. Boundary: keine Features, keine Major-Refactors.
|