Commit Graph

553 Commits

Author SHA1 Message Date
Sucukdeluxe
25b7104580 Release v2.0.0-beta.4 2026-03-08 19:19:32 +01:00
Sucukdeluxe
e0eab43763 Fix auto-updater pointing to stable repo instead of beta repo
DEFAULT_UPDATE_REPO was still set to Administrator/real-debrid-downloader
(the stable repo). Changed to Administrator/beta-real-debrid-downloader
so the beta app finds its own releases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:19:01 +01:00
Sucukdeluxe
4df0d40ece Release v2.0.0-beta.3 2026-03-08 19:16:38 +01:00
Sucukdeluxe
3567cc173c Fix cancelPackage not removing packages from session
cancelPackage only marked packages/items as cancelled but never removed
them from session.packages, session.items, or session.packageOrder.
The old download-manager called removePackageFromSession() which actually
deletes the entries. Now cancelPackage properly removes all items and the
package from the session, cleans up related state, and runs artifact
cleanup in the background.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:16:04 +01:00
Sucukdeluxe
ab08506361 Release v2.0.0-beta.2 2026-03-08 19:10:03 +01:00
Sucukdeluxe
6fd25a5447 Separate beta app identity to prevent overwriting stable installation
- appId: com.sucukdeluxe.realdebrid-beta
- productName: Real-Debrid-Downloader Beta
- name: real-debrid-downloader-beta
- Release script asset names updated for Beta suffix

Beta installs to separate directory and uses own userData path,
so both stable and beta can run side by side.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:08:54 +01:00
Sucukdeluxe
d0885ba552 Fix 16 bugs found by code review across all download modules
Critical fixes:
- Post-processor: remove double attempts increment (onProgress + onArchiveFailure both counted)
- Post-processor: fix slot leak when signal aborted after acquireSlot
- Scheduler: reset global watchdog high-water mark after stall event (prevents permanent misfires)
- Pipeline/DM: fix isPathInsideDir path traversal (add trailing separator check)
- Retry-manager: check per-kind exhaustion before shelve threshold (prevents bypass)
- Retry-manager: add MAX_SHELVE_COUNT=5 cap to prevent infinite shelve cycling

Important fixes:
- Scheduler: clear retryDelays and providerCooldowns on start()
- Scheduler: skip already-aborting slots in stall detection
- Download-manager: fix cleanupAfterExtraction using extractDir instead of outputDir for link removal
- Download-manager: add "extracting" to package normalizeSessionStatuses
- Download-manager: clear activeTasks map on stop()
- Download-manager: remove useless cachedDirectUrls re-insertion after success
- Stream-writer: remove duplicate truncation code in error path
- Stream-writer: skip alignedFlush in finally when bodyError already set (avoids 5min drain wait)
- Stream-writer: re-read elapsed after speed limiter sleep for accurate window reset
- Error-classifier: add HTTP 401 (Forbidden) and 410 (NotFound) classification

Tests updated to match new shelve/kind-exhaustion priority and 401 classification.
All 216 tests pass, build verified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:33:06 +01:00
Sucukdeluxe
36dc6040ba Release v2.0.0-beta.1 2026-03-08 18:17:54 +01:00
Sucukdeluxe
566483a438 chore: include pending changes from original project
Pre-existing uncommitted changes carried over from the original repo:
- download-manager.ts: HTTP 416 text check, resume preflight recovery
- test updates for auto-rename and download-manager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:16:59 +01:00
Sucukdeluxe
efa0909e11 feat: Download System v2 — complete rewrite of download pipeline
Replace monolithic download-manager.ts (9500 lines) with 7 focused modules:

- error-classifier.ts: 25+ typed DownloadErrorKind enum, classifier functions
  for network/HTTP/debrid/extraction errors — no more string matching
- retry-manager.ts: Declarative per-error-kind retry policies, exponential
  backoff, shelving after 15 failures, state export/import
- stream-writer.ts: HTTP stream → file with pre-resume validation, stall
  detection, NTFS-aligned buffered writing, Range-ignored detection
- pipeline.ts: Single download lifecycle (unrestrict → stream → verify),
  throws typed errors, caller decides retry strategy
- post-processor.ts: Extraction state machine with hard caps (3 attempts
  per archive, 5 rounds per package), no infinite loops
- scheduler.ts: Queue management with priority-based slot allocation,
  heartbeat stall detection, global watchdog, provider cooldowns
- download-manager.ts: Drop-in orchestrator (~1500 lines), same public API

Fixes:
1. Hanging downloads: heartbeat-based stall detection + global watchdog
2. Wrong error classification: typed enum at point of origin
3. Unreliable resume: file size vs tracker validation, Range-ignored detection
4. Extraction loops: bounded retries with state machine

215 new unit tests for error-classifier and retry-manager (all passing).
Build compiles cleanly. Same IPC interface — UI unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:14:17 +01:00
Sucukdeluxe
63b412a43f Release v1.7.50 2026-03-08 04:49:53 +01:00
Sucukdeluxe
2123a48bea Fix resume completion and rar fallback handling 2026-03-08 04:49:13 +01:00
Sucukdeluxe
4a27fd72c7 Release v1.7.49 2026-03-08 03:58:11 +01:00
Sucukdeluxe
2bd7a187f8 Fix resume retry fallback for truncated direct links 2026-03-08 03:57:37 +01:00
Sucukdeluxe
7c2c8def51 Release v1.7.48 2026-03-08 03:42:39 +01:00
Sucukdeluxe
38c9058beb Fix session stats, extraction UX, and queue UI issues 2026-03-08 03:42:06 +01:00
Sucukdeluxe
842933e748 Release v1.7.47 2026-03-08 02:55:03 +01:00
Sucukdeluxe
ef7905eeb4 Fix legacy extractor path handling 2026-03-08 02:54:37 +01:00
Sucukdeluxe
6c1db14e24 Release v1.7.46 2026-03-08 02:49:23 +01:00
Sucukdeluxe
935f05e214 Fix RAR native extractor fallback 2026-03-08 02:48:49 +01:00
Sucukdeluxe
53c411f635 Release v1.7.45 2026-03-08 02:36:11 +01:00
Sucukdeluxe
28113f57f3 Release v1.7.44 2026-03-08 02:28:51 +01:00
Sucukdeluxe
2a51c443b8 Release v1.7.43 2026-03-08 02:18:53 +01:00
Sucukdeluxe
4dd43c8d91 Release v1.7.42 2026-03-08 02:03:17 +01:00
Sucukdeluxe
e4b0f9001e Fix extraction retry loop on CRC/password failures 2026-03-08 02:02:39 +01:00
Sucukdeluxe
9eb28cee2e Add per-package detailed logs 2026-03-08 01:41:23 +01:00
Sucukdeluxe
ecfaf52ce9 Release v1.7.40 2026-03-08 01:04:05 +01:00
Sucukdeluxe
6b22c93554 Fix auto-recovery re-download for encrypted RAR5 archives
- Always force re-download once when both JVM and legacy extractors fail
  (suggestRedownload=true), regardless of valid archive signature
- Add autoRecoveredForRedownload Set for loop protection (one attempt per archive)
- Clear loop protection on package reset (clearHybridArchiveState)
- Previous sibling-items check failed when other episodes were already
  cleaned up after hybrid extraction
- Lower mini-download retry threshold from 100KB to 5KB

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:03:37 +01:00
Sucukdeluxe
cd5c0c5e7b Release v1.7.39 2026-03-08 00:50:33 +01:00
Sucukdeluxe
9e255d8110 Fix extraction failures on encrypted RAR5 archives with correct file content
- Retry extraction with 2.5s delay on CRC/password errors (Windows file handle race)
- Improve auto-recovery: force re-download when known password fails (content corruption)
- Expand auto-recovery to wrong_password category for encrypted RAR5
- Add fsync after download for pre-allocated files
- Fix permanent extraction failure loop for archives with valid headers but corrupt content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:50:03 +01:00
Sucukdeluxe
94126943d5 Release v1.7.38 2026-03-08 00:03:34 +01:00
Sucukdeluxe
27d75153b9 Boost hybrid extraction speed: G1GC, more threads, larger heap
- Switch JVM GC from SerialGC to G1GC with MaxGCPauseMillis=50
  for shorter pause times in long-lived daemon
- Increase JVM heap from 512m/8g to 1g/32g to reduce GC pressure
  on systems with plenty of RAM
- Raise hybrid thread cap from floor(cpuCount/2) capped 8
  to ceil(cpuCount*0.75) capped 12 — downloads are I/O-bound
  and don't need much CPU headroom
- Refresh daemon process priority before each request so hybrid
  extraction gets correct CPU priority even if daemon was started
  with a different priority level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:02:59 +01:00
Sucukdeluxe
fd3b5033a4 Release v1.7.37 2026-03-07 23:46:53 +01:00
Sucukdeluxe
d2689aa425 Fix stall-timeout for providers without fileSize (Mega-Debrid Web)
- Early-exit now also uses raw Content-Length as fallback when
  totalBytes is unknown (provider returned fileSize=0)
- Stall handler checks if file is already complete on disk before
  deleting and retrying — prevents re-download loop for files that
  finished but server delayed closing the connection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:46:16 +01:00
Sucukdeluxe
143d0921fc Release v1.7.36 2026-03-07 23:35:17 +01:00
Sucukdeluxe
00d873445c Fix stall-timeout false positives on fully downloaded small archive parts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:34:46 +01:00
Sucukdeluxe
46a64f9e95 Release v1.7.35 2026-03-07 23:15:42 +01:00
Sucukdeluxe
307dcf0815 Fix stop→start race conditions causing potential hang
- Add scheduler generation counter to prevent stale scheduler from
  continuing after stop/start cycle
- Guard processItem stop-abort handler: skip status overwrite when a
  new start() has already re-activated the session
- Yield in start() after recoverRetryableItems to let pending abort
  handlers complete before evaluating item states
- Add test: rapid stop → disable provider → start must resolve

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:15:05 +01:00
Sucukdeluxe
3032604496 Release v1.7.34 2026-03-07 22:33:46 +01:00
Sucukdeluxe
291c80c7fc Fix auto-recovery re-download loop: check archive magic bytes before forcing re-download
Files with valid RAR/7z/ZIP signature are not corrupt (wrong password),
only files with invalid signature get force-redownloaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:33:10 +01:00
Sucukdeluxe
3ab7b6c9a3 Release v1.7.33 2026-03-07 22:27:22 +01:00
Sucukdeluxe
556cbd1d85 Fix auto-recovery for CRC-corrupt archives with correct file sizes
- Trust extractor CRC verdict over file size checks
- Re-queue incomplete downloads instead of just warning

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:26:49 +01:00
Sucukdeluxe
2a429b49c0 Release v1.7.32 2026-03-07 22:14:24 +01:00
Sucukdeluxe
5c29355e9a Prevent repeated hybrid extraction retries 2026-03-07 22:13:51 +01:00
Sucukdeluxe
960b1fa046 Release v1.7.31 2026-03-07 21:53:49 +01:00
Sucukdeluxe
9bc9c984cb Fix hybrid auto recovery loops 2026-03-07 21:53:10 +01:00
Sucukdeluxe
1222cb08b5 Release v1.7.30 2026-03-07 21:27:42 +01:00
Sucukdeluxe
fb036733e3 Fix auto-recovery for stale archive parts 2026-03-07 21:27:03 +01:00
Sucukdeluxe
a322a16b7b Release v1.7.29 2026-03-07 21:09:28 +01:00
Sucukdeluxe
16bfbfc106 Fix archive underflow and extraction readiness 2026-03-07 21:08:43 +01:00