Multi-Hoster-Upload/lib
Administrator 233952af8f perf(doodstream): gate per-upload _debugLog behind logVerbose (default off) — drop ~8-15 sync fs syscalls/upload off the main loop
doodstream-upload.js's _debugLog ran with NO verbose gate: every call did a
synchronous statSync (via maybeRotateLogFile) + appendFileSync directly on the
main-process event loop, ~8-15x per upload (server probe, response, redirect,
result page, filecode parse, hidden fields, submit/follow, plus retry branches).
DoodstreamUploader runs in the main process, so each pair of sync fs syscalls
blocked the event loop while uploading — delaying IPC, upload-progress-batch
forwarding, tray-tooltip and webhook handling for every other concurrent upload.
A constant per-upload main-thread tax (not history-scaling), surfaced by the
session-wide lag audit and confirmed as the one finding that bites in the real
upload scenario.

Fix: gate _debugLog behind the existing globalSettings.logVerbose setting
(default false), exactly mirroring main.js logDebug/_logVerbose. A module-level
_debugVerbose flag + setDebugVerbose() setter, an early-return at the top of
_debugLog, and one wire at main.js's single setLogVerbose chokepoint (covers
boot + save-config + the verbose toggle). When verbose is off the doodstream
trace simply isn't written — same contract as the main debug.log — and the
per-upload sync fs disappears. When a doodstream issue needs tracing, enabling
verbose restores the full trace.

The config-store audit findings (load() history-clone cost, per-write history
serialize) are real but scale only with history size — tens of microseconds at
this user's 8-batch config, and the safe fix is risky persistence surgery on
credential-bearing code for a latent micro-cost; deferred and documented in
tasks/todo.md rather than shipped.

397/397 tests pass, eslint clean, gate wiring verified (shared module instance,
default-off, toggles).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 02:29:59 +02:00
..
account-auth.js fix(doodstream): upload via the doodapi API when an API key exists 2026-05-28 21:42:19 +02:00
account-rotation.js fix(rotation): persist the round-robin cursor so drip-fed uploads keep rotating 2026-06-17 03:33:20 +02:00
backup-crypto.js feat(backup): import legacy password-encrypted backups 2026-04-17 11:22:33 +02:00
clouddrop-upload.js perf: final sweep — hot-path allocation, cached log target, sort-header skip 2026-04-19 14:02:34 +02:00
coalesced-set.js test(coalesce): extract done-removal coalescer + 11 unit tests 2026-04-28 11:59:32 +02:00
config-store.js perf(config): cache parsed config + lean serialize + drop load() from log flush (long-run lag) 2026-06-21 00:49:55 +02:00
diagnostics-agent.js fix(diagnostics): harden read-only agent — grep ReDoS, prototype-chain whitelist bypass, redaction gaps 2026-06-19 18:40:57 +02:00
diagnostics-collectors.js fix(diagnostics): harden read-only agent — grep ReDoS, prototype-chain whitelist bypass, redaction gaps 2026-06-19 18:40:57 +02:00
doodstream-upload.js perf(doodstream): gate per-upload _debugLog behind logVerbose (default off) — drop ~8-15 sync fs syscalls/upload off the main loop 2026-06-21 02:29:59 +02:00
file-probe.js fix(rotation): suspect byse rejections now reach every account instead of dying on the first 2026-06-15 01:11:37 +02:00
folder-monitor.js 🐛 fix: folder monitor re-detect deleted files, atomic sync save 2026-03-21 13:31:54 +01:00
hosters.js revert(byse): drop the v3.3.78 truncated-host rejection (added cost, no benefit) 2026-06-19 02:31:57 +02:00
ip-allowlist.js feat(diagnostics): network bind + fail-closed IP allowlist + host-in-code (Tailscale, like rd-diagnostics-mcp) 2026-06-19 19:32:29 +02:00
log-mode.js fix(log): persist BARE log path (no compounded daily/session stamps) 2026-06-04 22:08:15 +02:00
log-policy.js feat(log): per-hoster toggle for writing links to fileuploader.log 2026-05-23 15:29:25 +02:00
log-rotation.js test(log): extract log-rotation into testable module + 10 unit tests 2026-04-28 05:10:53 +02:00
orphan-tmp.js fix(queue): close two lost-work / sticky-ghost edge cases found by intensive testing 2026-06-19 06:51:48 +02:00
queue-dedup.js fix(queue): close two lost-work / sticky-ghost edge cases found by intensive testing 2026-06-19 06:51:48 +02:00
queue-prune.js test(queue): extract terminal-job prune into testable module + 10 tests 2026-04-28 06:41:47 +02:00
remote-capture-preload.js debug: add IPC logging from capture window to main process 2026-03-12 08:46:18 +01:00
remote-capture.html fix: native resolution capture + correct click offset for title bar 2026-03-12 08:55:46 +01:00
remote-server.js feat(diagnostics): network bind + fail-closed IP allowlist + host-in-code (Tailscale, like rd-diagnostics-mcp) 2026-06-19 19:32:29 +02:00
secret-store.js fix: encrypt hoster credentials at rest; history CSV Link column urls-only 2026-04-19 11:53:59 +02:00
semaphore.js test: add unit tests (41) and UI smoke tests (21), fix semaphore listener leak 2026-03-10 10:55:50 +01:00
stats.js feat(ui): per-hoster success rate, session-paused badge, post-batch retry, link export formats 2026-06-07 20:32:35 +02:00
support-bundle.js fix(diagnostics): harden read-only agent — grep ReDoS, prototype-chain whitelist bypass, redaction gaps 2026-06-19 18:40:57 +02:00
throttle-timer.js fix(queue): completed files no longer reappear in the queue after restart 2026-06-19 04:35:27 +02:00
throttle.js fix: multiple bugs found in deep code analysis 2026-03-11 04:16:50 +01:00
throttled-cache.js test(sort): extract throttled-cache utility + 12 unit tests 2026-04-28 07:12:52 +02:00
updater.js fix(stability): wrap hot timers/callbacks in try/catch, safeSend, updater waits for batch 2026-06-08 21:28:12 +02:00
upload-log.js fix(queue): stop finished uploads from re-appearing as pending ghosts across restart 2026-06-19 14:53:04 +02:00
upload-manager.js fix(byse): treat 5xx/gateway upload failures as transient infra, not account faults 2026-06-19 01:56:11 +02:00
vidmoly-upload.js fix(critical): safeSend infinite recursion + queueMicrotask, plus 6 audit findings 2026-06-08 22:03:19 +02:00
voe-upload.js chore: remove unused imports (powerSaveBlocker, statusCode) 2026-03-22 14:49:43 +01:00
webhook-notify.js fix(webhook): retry+429+status handling, await before shutdown, error-path notify, abort/auto-retry suppress, Discord limits 2026-06-10 00:08:02 +02:00