real-debrid-downloader/tests
Sucukdeluxe 2646cba1c7 Fix: Stille Datei-Korruption auf Windows bei vorab-allozierten Downloads (Null-Bytes am Ende)
Auf Windows wird die Zieldatei vor dem Download auf die erwartete Groesse
vorab-alloziert (zero-extend via fd.truncate(item.totalBytes)) und dann ueber
einen r+/start:0-Stream beschrieben — dieser ueberschreibt ab Offset 0, kuerzt
die Datei aber nie. item.totalBytes ist dabei die Provider-Metadaten-Groesse
(knownTotal), nicht zwingend die echte content-length.

Lieferte der Server real weniger Bytes als vorab-alloziert (content-length kleiner
als die Provider-Angabe, oder Verbindungsabbruch mit sauberem EOF), blieb der
Schwanz der Datei mit Null-Bytes gefuellt. Die anschliessende stat-Korrektur hat
`written` dann FAELSCHLICH auf die On-Disk-Groesse (= Alloc-Groesse inkl.
Null-Padding) HOCHgesetzt. Dadurch wurde sowohl die Underflow-Pruefung als auch
das nachgelagerte Pre-alloc-Truncate ausgehebelt: Das Item galt als zu 100%
fertig, obwohl ein grosser Teil der Datei Nullen waren — echte Datentraeger-
Korruption, exakt auf der Plattform des Nutzers (win32).

Fix: Neue reine Funktion reconcileFinalizedSize() entscheidet die Korrektur.
Fuer vorab-allozierte Dateien wird `written` nur noch nach UNTEN korrigiert
(echter Kurz-Write), niemals nach oben auf das Null-Padding. Damit greifen die
bestehende Underflow-Validierung und das Pre-alloc-Truncate wieder wie vorgesehen:
- Voll heruntergeladen (content-length erreicht): Null-Padding wird abgeschnitten,
  Datei ist korrekt.
- Echt zu kurz: wird korrekt als Underflow erkannt und neu versucht.

Verhaltensaenderung (bewusst): Wenn die Provider-Metadaten-Groesse die echte
Dateigroesse UEBERSCHAETZT (Provider sagt 1 GB, echte Datei ist 300 MB und
vollstaendig), galt der Download bisher still als fertig (mit Null-Padding-
Korruption). Jetzt wird er als Underflow gewertet und neu versucht. Sichtbarer
Fehlschlag ist einem still korrupten "fertigen" File vorzuziehen. Die
ALLOCATION_UNIT_SIZE-Toleranz deckt kleine Abweichungen weiterhin ab. (Falls je
ein "wiederholt denselben Link" gemeldet wird, fuehrt die Spur hierher.)

Test: reconcileFinalizedSize-Matrix (Pre-alloc+Padding bleibt echte Byte-Zahl,
Pre-alloc+Kurz-Write schrumpft, Nicht-Pre-alloc beidseitig, Invalid-stat,
No-op-Gleichstand) — der Padding-Fall ist rot ohne den Fix.
2026-06-17 04:48:11 +02:00
..
account-check.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
account-rotation-log.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
app-order.test.ts Release v1.6.18 2026-03-04 17:31:20 +01:00
audit-log.test.ts Harden support logging and debug setup 2026-03-09 02:47:49 +01:00
auto-rename.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
backup-crypto.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
backup-payload.test.ts Backup: nur Settings als Default + 4 Selektions/Flicker-Bugfixes 2026-06-07 04:40:54 +02:00
bestdebrid-web.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
cleanup.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
container.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
conversion-trace.test.ts Diagnose: Vollstaendiges Conversion-Trace-Logging (conversion.log) fuer haengende/langsame Link-Umwandlung 2026-06-17 02:52:44 +02:00
debrid.test.ts Fix: 1fichier/DDownload-Fehler respektiert jetzt "Auto-Fallback aus" 2026-06-17 04:37:42 +02:00
debug-server.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
desktop-rename-log.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
download-completion.test.ts Fix: Stille Datei-Korruption auf Windows bei vorab-allozierten Downloads (Null-Bytes am Ende) 2026-06-17 04:48:11 +02:00
download-manager.test.ts Härtung Download/Rotation (Audit-Batch 1): Scheduler-Freeze, Cooldown-Respekt, Daily-Reset, Kategorisierung 2026-06-17 04:22:20 +02:00
error-ring.test.ts Add extended diagnostics logging 2026-06-07 17:00:06 +02:00
extractor-jvm.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
extractor.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
fs-error.test.ts Add extended diagnostics logging 2026-06-07 17:00:06 +02:00
german-audio-integration.test.ts Feature: Tonspur-Ergebnis sichtbar am Paket (audioStripSummary) 2026-06-09 20:42:22 +02:00
hybrid-collect-race.test.ts Fix: Hybrid-Race liess .DL.+Doppeltonspur auf einzelnen Episoden zurueck 2026-06-10 15:53:47 +02:00
integrity.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
item-log.test.ts Harden download integrity, extraction safety, and update security 2026-03-28 16:27:21 +01:00
link-export.test.ts Add app runtime statistics 2026-03-09 04:59:00 +01:00
link-parser.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
log-timestamp.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
mega-debrid-errors.test.ts Fix: Mega-Debrid-Umwandlung robust + parallel — schneller Retry, alle Accounts, sichtbarer Grund 2026-06-17 02:07:25 +02:00
mega-public-api.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
mega-web-fallback.test.ts Mega-Debrid: Link-Umwandlung parallel ueber mehrere Accounts (per-Account-Queue + Tiefen-Routing) 2026-06-16 23:36:22 +02:00
notify-hooks.test.ts Test: Regressionstests fuer die Failed-Transition-Benachrichtigung (Mixed-Paket, Dedup, Run-Guard, Marker-Freigabe) 2026-06-10 00:37:40 +02:00
notify.test.ts Fix: Webhook-Zustellung haertbar — Discord-Rate-Limit, Retries, Kappung, Logging 2026-06-10 00:17:57 +02:00
package-log.test.ts Harden download integrity, extraction safety, and update security 2026-03-28 16:27:21 +01:00
package-order.test.ts Backup: nur Settings als Default + 4 Selektions/Flicker-Bugfixes 2026-06-07 04:40:54 +02:00
realdebrid-web.test.ts Fix Real-Debrid web login session reuse 2026-03-09 00:03:05 +01:00
realdebrid.test.ts Release v1.4.27 with bug audit hardening fixes 2026-02-28 14:12:16 +01:00
rename-log.test.ts Add dedicated rename support logging 2026-03-09 04:48:58 +01:00
resolve-archive-items.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
selection.test.ts Backup: nur Settings als Default + 4 Selektions/Flicker-Bugfixes 2026-06-07 04:40:54 +02:00
self-check.ts Comprehensive bugfix release v1.6.45 2026-03-05 03:53:28 +01:00
session-log.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
session-restart-loss.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
startup-health-check.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
storage.test.ts UI Phase 2: Einstellungen-Tab neu strukturiert (Untergruppen + Erklaertexte) + konfigurierbarer Verlauf (Obergrenze + Zeitlimit) 2026-06-15 00:49:19 +02:00
support-bundle.test.ts Fix: Support-Bundle-Export friert die UI nicht mehr 1-2 Minuten ein (asynchrones IO) 2026-06-17 03:14:01 +02:00
trace-log.test.ts Harden support logging and debug setup 2026-03-09 02:47:49 +01:00
unrestrict-retry.test.ts Härtung Download/Rotation (Audit-Batch 1): Scheduler-Freeze, Cooldown-Respekt, Daily-Reset, Kategorisierung 2026-06-17 04:22:20 +02:00
update-restart-resume.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
update.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
utils.test.ts chore: remove all source code comments and internal artifacts 2026-06-06 04:53:54 +02:00
video-processor.test.ts Fix: zu weite Deutsch-Erkennung konnte falsche Tonspur behalten 2026-06-08 22:31:34 +02:00