-
v2.0.0-beta.1 Stable
released this
2026-03-08 18:17:54 +01:00 | 9 commits to main since this releaseDownload System v2 — Complete Rewrite (Beta)
What's New
- Modular architecture: Monolithic download-manager.ts (9,500 lines) split into 7 focused modules
- Typed error classification: 25+ error kinds (DownloadErrorKind enum) replace string matching — errors classified at point of origin
- Declarative retry policies: Per-error-kind policies with exponential backoff, provider cooldowns, and file reset actions
- Reliable resume: Pre-resume file validation (size vs tracker), Range-ignored detection, corrupt file cleanup
- Extraction state machine: Bounded retries (max 3/archive, max 5 rounds/package) — no more infinite loops
- Stall detection: Heartbeat-based per-download monitoring + global watchdog for zero-progress detection
- Shelving mechanism: After 15 total failures, 90s pause + halve counters + switch provider
Architecture (new modules in src/main/download/)
error-classifier.ts— Typed error system, classifier functionsretry-manager.ts— Retry policies, backoff, shelving, state persistencestream-writer.ts— HTTP stream to file, NTFS-aligned buffering, stall detectionpipeline.ts— Single download lifecycle (unrestrict → stream → verify)post-processor.ts— Extraction state machine with bounded retriesscheduler.ts— Queue management, slot allocation, heartbeat monitoringdownload-manager.ts— Drop-in orchestrator (~1,500 lines)
Fixes
- Downloads hanging without clean restart → heartbeat stall detection + global watchdog
- Wrong error classification leading to wrong retry paths → typed DownloadErrorKind enum
- Unreliable resume causing corrupt files → pre-resume validation + Range-ignored detection
- Post-processing extraction breaking or looping → bounded retry state machine
Testing
- 215 new unit tests for error-classifier and retry-manager (all passing)
- Same IPC interface — UI unchanged, drop-in replacement
- Build compiles cleanly