Commit Graph

358 Commits

Author SHA1 Message Date
Administrator
a6ff2dd587 chore(main): drop JSON.stringify of files/hosters in start-upload log
At 500+ queued jobs these lines bloated upload-debug.log with
megabyte-sized entries per batch-start and added visible latency to
the IPC handler. Log sizes only.
2026-04-21 19:31:07 +02:00
Administrator
f5a5cfdf2c release: v3.1.5 2026-04-21 17:04:35 +02:00
Administrator
bf806cb069 fix(rotation): session-learning for account failures is now complete
Three related gaps closed so one full byse account stops wasting
attempts on every subsequent job and later-added accounts get picked
up without an app restart.

1. Pre-job-swap moved BEHIND the semaphore acquire. At scale (500 jobs
   / 1 slot) every worker was checking _failedAccounts at spawn time
   before the first upload had even tried — so none of them saw the
   failed state. Now each worker re-checks right before its first
   upload attempt.

2. save-config IPC handler re-resolves fallbacks for any account that
   is already in _failedAccounts but has no override set. Previously
   account-failed only fired once per account, so a config change
   after the first mark-failed was silently ignored and the batch
   stayed stuck on the dead account until the app restarted.

3. UploadManager exposes getFailedAccountKeys() and getOverride(hoster)
   so main.js can drive the late re-resolve without poking private
   fields.

4 new tests: pre-job-swap after semaphore, getters contract, fresh
manager resets learned state, late-added fallback is honored by
subsequent jobs. 80/80 green.
2026-04-21 17:03:59 +02:00
Administrator
e5f9f91f4e release: v3.1.4 2026-04-21 16:43:29 +02:00
Administrator
17e9a419b2 fix(rotation): treat byse "disk space" as account-level, not file-rejected
Byse rejects uploads with status like "not enough disk space on your
account" when the account's storage is exhausted. The parser was
flagging every non-OK status as err.fileRejected=true, and the upload-
manager classifier additionally matched the generic "lehnte Datei ab"
prefix as file-rejected. Result: rotation was skipped on a full account
and every subsequent file failed on the same dead account.

- hosters.js: byse parser now distinguishes account-level phrases
  (disk space / storage / quota / insufficient / account full) and sets
  err.accountError=true for those. File-specific failures (Duplicate,
  wrong format, size) keep err.fileRejected=true.
- upload-manager.js: _isFileRejectedError no longer matches the generic
  "lehnte Datei ab" prefix and short-circuits when err.accountError is
  true. _shouldSkipRetryOnAccountError honors the flag and has added
  regex patterns as a safety net.
- Tests: 5 new unit tests covering disk-space/account-level/duplicate
  and the accountError-wins-over-fileRejected precedence.
2026-04-21 16:42:56 +02:00
Administrator
e3a785d4a7 release: v3.1.3 2026-04-21 16:15:32 +02:00
Administrator
f3b1c25d8b perf(queue): halve sync work on retry of many jobs
retrySelectedJobs() was calling renderQueueTable + updateQueueActionButtons
+ updateStatusBar and then immediately awaiting startSelectedUpload(),
which runs the exact same trio right after. At 500+ failed jobs the
double render/sort/button-refresh freezes the UI for several seconds
after clicking "Erneut versuchen".

Drop the outer render trio — startSelectedUpload's one is enough. The
inner call sees the freshly-mutated job state in the same tick, so the
visible result is identical with half the work.
2026-04-21 16:14:58 +02:00
Administrator
187eff2429 release: v3.1.2 2026-04-20 16:10:30 +02:00
Administrator
d8821a46ee release: v3.1.1 2026-04-20 16:09:54 +02:00
Administrator
1e449e3d67 fix(byse): poll file list when response has empty filecode
User reported uploads appearing on the byse dashboard (2+ GB MKV,
Server #262, status OK) even though the app marked them failed. The
byse API sometimes replies with msg=OK + files:[{filecode:"",
status:"Not video file format"}] — a misleading response where the
file is actually being accepted and gets its filecode assigned
asynchronously.

  - Before the upload POST, snapshot the current /api/file/list to
    know what was already there.
  - If parseByseResult returns an empty filecode (or throws a
    fileRejected error), poll /api/file/list up to 15 × 2s looking
    for a new file_code matching the uploaded filename (case/punct
    normalized, extension stripped).
  - If matched, return the real download/embed URLs and let the
    upload complete as successful. Only throw the parser's error
    if polling also finds nothing.
2026-04-20 16:09:28 +02:00
Administrator
927fbc5895 release: v3.1.0 2026-04-20 16:06:33 +02:00
Administrator
7ed227a76e fix(byse/rotation): surface per-file rejection, skip retries and rotation
The log revealed byse's true response shape for rejected files:
  { msg: 'OK', status: 200, files: [{ filecode: '', status: 'Not video file format' }] }

HTTP 200 + msg=OK made the old code treat it as 'success but no
file_code'. The real error ('Not video file format') was buried in
files[0].status. parseByseResult now surfaces that with a dedicated
err.fileRejected flag so the rotation layer can distinguish
file-specific vs account-specific failures.

Rotation behavior:
  - file-rejected errors: no retries, no account blacklist, no
    rotation. The same file is going to get the same verdict on
    any account, so skip straight to 'error' status and keep the
    account available for other files in the batch.
  - network errors (already handled): no account blacklist either.
  - everything else: unchanged (retry then rotate).

Also added pattern matches for common rejections (Duplicate, File
too small/large, Unsupported format, etc.) so other hosters'
per-file errors get the same treatment.
2026-04-20 16:06:09 +02:00
Administrator
c696b0cb0e release: v3.0.9 2026-04-20 15:57:08 +02:00
Administrator
0ea92ad6d0 fix(rotation): transient network errors don't blacklist the account + clearer byse 'OK' error
Two bugs visible in the user's rotation log:

  1. 'error=OK' for byse.sx — the server returned a payload with
     msg='OK' and no file_code anywhere we recognized. Our generic
     uploadFile threw the bare 'OK' as the error message, which is
     useless and misleading. Now when we see an ok-ish msg without
     the expected file_code we throw a descriptive error that
     includes the first ~400 bytes of the payload so the next time
     it happens we can see what's actually being returned (API
     changed, new field name, etc.).

  2. 'getaddrinfo ENOTFOUND s1055.filemoon' was marking accounts as
     permanently failed, blacklisting BOTH byse accounts within the
     same batch even though neither was the actual problem — filemoon
     (byse's storage backend) briefly had a DNS blip. Added
     _isTransientNetworkError() covering DNS/ECONNRESET/ETIMEDOUT/etc.
     When all retries on an account exhaust with a transient error,
     we now fail just that file and emit 'skip-rotation-transient'
     instead of adding the account to _failedAccounts. Other files
     in the same batch still get a fresh try on the same account.
2026-04-20 15:56:44 +02:00
Administrator
22869df8a5 release: v3.0.8 2026-04-20 14:13:38 +02:00
Administrator
bb89de3c93 perf: tab switch O(1), parallel settings save, cached hoster counts, sort-cache reuse
Four user-visible lag sources tracked down from a wider audit:

  - Tab click was running three full querySelectorAll walks per click
    (remove active from all tabs, all views, find new tab). Replaced
    with delegated listener on the tab bar plus cached node maps;
    tab switching is now O(1) and a no-op when clicking the active tab.

  - saveSettings awaited saveHosterSettings + saveGlobalSettings
    serially and then re-fetched the full config from main. With
    autosave firing on every keystroke this added 100–200ms of IPC
    stall per input change. The two saves now run in parallel and the
    post-save getConfig refetch is gone — we know the new state.

  - showContextMenu rebuilt hosterCounts (queueJobs.forEach) on every
    right-click. Replaced with a length-keyed cache; right-click on a
    5000-job queue no longer pauses while counting.

  - Recent-panel shift-click was querying every .recent-file-row in
    the DOM and re-parsing data-order. Reuses _recentSortCache.result
    instead, O(visible) vs O(N).
2026-04-20 14:13:09 +02:00
Administrator
530fd03c22 release: v3.0.7 2026-04-19 23:30:40 +02:00
Administrator
f6b1ef96b7 feat(log): auto-persist fallback path into settings
When the configured log path isn't writable and we fall back to
Desktop/userData, the working fallback now gets saved into
globalSettings.logFilePath automatically. Benefits:

  - Next session writes directly to the known-working path, no
    fallback ladder, no recurring toast warning.
  - The Settings input reflects the actual path in use, so users
    don't stay confused about where their uploads are being logged.
  - Live update via IPC — if the Settings view is currently open,
    the input value updates without needing a view switch.

Daily-log mode is handled: we strip the -YYYY-MM-DD suffix before
persisting so tomorrow's auto-rotation doesn't double-date the
filename.
2026-04-19 23:30:14 +02:00
Administrator
90ba69d1b0 release: v3.0.6 2026-04-19 23:20:44 +02:00
Administrator
c5c31aa323 fix(ui): log-fallback warning is a toast, not a blocking alert()
alert() in Electron halts the renderer main thread until the user
clicks OK — the upload table, status bar and progress all freeze.
During a 170-file batch the dialog popped up mid-upload and froze
everything for however long the user took to dismiss it (which is
why stats updates lagged to one every 3-5s instead of the usual 1s
cadence).

Replaced with the same showCopyToast used elsewhere, with an 8s
duration so the message is still readable. showCopyToast now accepts
an optional durationMs argument.
2026-04-19 23:20:17 +02:00
Administrator
7a5278012b release: v3.0.5 2026-04-19 23:13:53 +02:00
Administrator
63f87a0310 fix(rotation): concurrent jobs now reuse the override instead of failing
When multiple jobs run in parallel on the same hoster and the primary
account starts failing, the first job marks it failed + triggers
rotation. The second job's retries then also exhaust on the same
(already-failed) primary — but the old while-condition
`!_failedAccounts.has(...)` short-circuited the whole rotation loop
for anything already marked, so the second job went straight to
final-error even though a resolved override was sitting right there.

Now the loop always checks for an available override; it only skips
the mark-failed + emit step if the account was already marked by a
concurrent job. Fixed visible symptom: first job rotates A→B, every
other job in the same batch that hit A got final-error instead of
also switching to B.

Also extended fast-fail patterns to include 429 (Too many requests),
CSRF-Token / 'Bist du eingeloggt' — both were showing up as the
primary failure mode in real uploads and were wasting 5 retries
each.
2026-04-19 23:13:25 +02:00
Administrator
b7336eefb8 release: v3.0.4 2026-04-19 23:04:47 +02:00
Administrator
655fb6230b feat(rotation): fast-fail on account-specific errors + open-log-folder button + sync rot-log flush
Three related improvements that landed together while wiring up the
rotation log infrastructure:

  - Fast-fail classifier: errors that clearly indicate the account
    itself is the problem (rate limit, quota, banned/suspended, auth
    failure, 401/403, 'Kein Upload-Server' from delivery-node etc.)
    now skip the remaining retries and go straight to rotation. No
    more waiting 5 × 3s between retries just to end up rotating
    anyway. Emits a 'fast-fail' rot-log event so the shortcut is
    visible.

  - Settings: 'Öffnen' button next to the log-file-path input reveals
    the active log file (or its directory if nothing's written yet)
    in the OS file manager, so users don't have to remember paths.

  - rotLog() writes the rotation log synchronously. Only a handful
    of events fire per batch; the 500ms flush batching was saving
    nothing and made the file look empty when users checked right
    after an event. (The main debug log still uses the batched async
    path — that one is high-volume.)
2026-04-19 23:04:20 +02:00
Administrator
796aeb520d release: v3.0.3 2026-04-19 22:57:48 +02:00
Administrator
126b1e569a feat(account-rotation): dedicated logging + live toast notifications
To trace whether the fallback chain actually engages during real uploads,
every rotation decision now emits a structured 'rot-log' event from the
upload-manager. main.js persists each event to a new account-rotation.log
(same directory as fileuploader.log; falls back to Desktop then userData)
and also mirrors it into the main debug log with a [ROT] prefix for
single-file grepping.

Logged events:
  - batch-start (clears _failedAccounts / _accountOverrides)
  - pre-job-swap / pre-job-swap-blocked (job picks override before first try)
  - retries-exhausted / mark-failed (enters rotation loop)
  - rotate (switched to new account, retry starting)
  - rotation-end (no override / override already failed)
  - final-error (all accounts exhausted)
  - switchAccount (main resolved the next fallback)

The renderer shows a toast on 'rotate', 'rotation-end' and 'final-error'
so fallback behavior is visible live instead of buried in logs.
2026-04-19 22:57:19 +02:00
Administrator
9b5184f76f release: v3.0.2 2026-04-19 22:49:40 +02:00
Administrator
9c679bd442 perf(accounts): event delegation + in-place card updates
The Accounts view rebuilt the whole list on every enable/disable/
check/reorder. Each render destroyed and recreated four click
listeners plus five drag listeners per card (20 accounts = 180
listeners cycled per click), then ran an IPC getConfig round-trip
on top. Typing-fast enable/disable toggles felt sludgy.

  - Single delegated click handler on the accounts container.
  - Single delegated set of drag/drop handlers (one per event type,
    not per card).
  - Listeners are bound once on first render, never rebound.
  - updateAccountCard(accountId) swaps just the one affected card's
    DOM node when its state changes. toggleAccount / checkSingleAccount
    use that instead of calling renderAccounts.
  - Drag-and-drop reorder moves the DOM node in place and re-renders
    only the priority badges of the affected group — no container
    rebuild, no getConfig refetch.
2026-04-19 22:49:11 +02:00
Administrator
00a46dee2e release: v3.0.1 2026-04-19 22:43:43 +02:00
Administrator
6a40fdd435 fix(vidmoly): correct multipart fields & JSON response shape
Captured the real browser upload POST and compared to our request.
Two corrections:

  - The file field is named 'file', not 'file_0'. The XFS-indexed
    naming was a bad guess — the current transit accepts only 'file'.
  - The form also needs 'to_json=1' (forces JSON response instead of
    an HTML redirect page, matching what the browser submits) and
    'fld_id=0' (destination folder, 0 = root). Dropped upload_type,
    srv_tmp_url, utype — those were XFS remnants and aren't part of
    the current server's contract.
  - Response shape is now { status: 'OK', file_code, msg } instead of
    the older { files: [...] } / { result: ... } XFS variants; the
    parser handles all three plus carries the server's msg forward
    on explicit rejections.
2026-04-19 22:43:17 +02:00
Administrator
5d43923217 release: v3.0.0 2026-04-19 22:42:08 +02:00
Administrator
0dcd62ac26 fix(vidmoly): append X-Progress-ID query param to transit upload URL
The transit server runs nginx-upload-progress and requires an
X-Progress-ID query parameter on the POST URL to finalize the
upload session. Without it the server accepts all bytes but never
sends the response — matches the reported 99%-stuck behavior. The
browser appends it automatically before submit; we now do the same.
2026-04-19 22:41:43 +02:00
Administrator
7ea718ee27 release: v2.9.9 2026-04-19 22:37:38 +02:00
Administrator
0405c28245 fix(vidmoly): strip vidmoly.me cookies on cross-origin transit POST + add XFS fields
Upload stalled at 99% because we were sending vidmoly.me cookies to
*.vmwesa.online (transit server rejects them silently). Browsers never
send those cross-origin. Now we omit the Cookie header and match the
Origin/Referer the browser uses. Also added the full classic XFS field
set (upload_type, sess_id, srv_tmp_url, utype) in the order the
server's handler expects.
2026-04-19 22:37:11 +02:00
Administrator
c8aeaf1de0 release: v2.9.8 2026-04-19 22:31:58 +02:00
Administrator
da4ac95c3c fix(vidmoly): login via new POST /api/auth/login with JSON
The SPA redesign killed the old XFS form POST at / with op=login.
The new flow is a JSON POST to /api/auth/login that returns a
vidmoly_session HttpOnly cookie, which is what /api/upload/config
actually authenticates against.

After login we also probe /api/upload/config once to fail fast if
the session was issued but not actually valid for uploads.
2026-04-19 22:31:32 +02:00
Administrator
961d59f8b8 release: v2.9.7 2026-04-19 22:28:13 +02:00
Administrator
5c7bfb48b9 fix(vidmoly): probe /api/upload/config to verify login
The old /my HTML check failed because it couldn't distinguish an XFS
session from a full SPA session. Since /api/upload/config is what the
upload actually needs, probe it directly after login — 200 JSON with
sess_id/upload_url means we're good, anything else means we're out.
2026-04-19 22:27:49 +02:00
Administrator
d0c9df7656 release: v2.9.6 2026-04-19 22:24:33 +02:00
Administrator
0e7ae5ee7b fix(vidmoly): use new /api/upload/config endpoint
The Vidmoly SPA redesign removed the /?op=upload HTML form — the old
regex-scrape of hidden inputs no longer works. The site now exposes
GET /api/upload/config which returns { sess_id, upload_url } plus the
allowed extensions. Rewrote getUploadParams() to use that endpoint;
the rest of the multipart upload flow (sess_id + utype + file_0) is
the same classic XFS shape.
2026-04-19 22:24:10 +02:00
Administrator
8e49733241 release: v2.9.5 2026-04-19 22:11:06 +02:00
Administrator
a0eae7f380 release: v2.9.4 2026-04-19 22:09:29 +02:00
Administrator
bf39b6c180 release: v2.9.3 2026-04-19 22:08:50 +02:00
Administrator
2dc94084ab fix: vidmoly login verification + retry stale-uploadId + faster account toggle
Three fixes bundled:

  - Vidmoly redesign broke login: the old check required either the
    'login' or 'xfsts' cookie, but the new site sets different cookie
    names. Now we verify by fetching /?op=my_account and looking for
    logged-in markers (Logout / My Account / My Files) in the body
    instead of relying on specific cookie names.

  - retrySelectedJobs left the stale uploadId in _jobIndexByUploadId
    when resetting a job. A late 'aborted'/'error' event from the
    original (cancelled) upload could route back to the reset job
    and overwrite its 'preview' state. Now the old uploadId is
    removed from the index and marked in _deletedJobIds so those
    stragglers get dropped.

  - toggleAccount did two IPC round-trips (saveConfig + getConfig) on
    every enable/disable click, plus four re-renders (Accounts,
    HosterSummary, HosterModal, Settings). Rapid clicks felt laggy.
    The getConfig refetch is redundant since we mutated the flag in
    place, and HosterModal/Settings don't depend on account enabled
    state. Click now renders immediately and the save runs async.
2026-04-19 22:08:22 +02:00
Administrator
976be2f566 release: v2.9.2 2026-04-19 22:02:35 +02:00
Administrator
edf35e9636 release: v2.9.1 2026-04-19 22:01:47 +02:00
Administrator
880537dcfb fix: multi-level account rotation + clear failed-accounts per batch + size-sort staleness
Three state bugs found during audit:

  1. _failedAccounts / _accountOverrides survived across batches. A
     rate-limited account from batch 1 stayed permanently blacklisted
     for the rest of the app session, so batch 2 skipped straight to
     the fallback even after the original recovered. Now cleared in
     startBatch so each run evaluates accounts fresh.

  2. Account rotation was one level deep. With three accounts [A,B,C]
     on the same hoster and A + B both failing, the job errored out
     — C was never tried. The fallback-retry was a single if-block.
     Replaced with a while-loop that keeps asking main for the next
     override and rotating until every account is exhausted.

  3. Queue sort cache included 'size' as a static key, but bytesTotal
     goes 0 → actual when previews resolve. A queue sorted by size
     during preview would cache the all-zeros order and never update.
     Removed size from _STATIC_SORT_KEYS — it now re-sorts per render
     like status/speed/progress.
2026-04-19 22:01:20 +02:00
Administrator
5265bcd77a release: v2.9.0 2026-04-19 14:07:23 +02:00
Administrator
4f2d462754 perf: single-pass escapeHtml/escapeAttr
Hot path on large table rebuilds — every text cell runs through one
of these. Switching from 4 chained .replace() calls to a single regex
with a lookup map is ~3× faster. At 5000 rows × 4 fields per rebuild,
80k → 20k regex operations.
2026-04-19 14:06:52 +02:00
Administrator
b4c26f8106 release: v2.8.9 2026-04-19 14:02:59 +02:00