• v2.0.0-beta.1 36dc6040ba

    v2.0.0-beta.1 Stable

    Administrator released this 2026-03-08 18:17:54 +01:00 | 9 commits to main since this release

    Download 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 functions
    • retry-manager.ts — Retry policies, backoff, shelving, state persistence
    • stream-writer.ts — HTTP stream to file, NTFS-aligned buffering, stall detection
    • pipeline.ts — Single download lifecycle (unrestrict → stream → verify)
    • post-processor.ts — Extraction state machine with bounded retries
    • scheduler.ts — Queue management, slot allocation, heartbeat monitoring
    • download-manager.ts — Drop-in orchestrator (~1,500 lines)

    Fixes

    1. Downloads hanging without clean restart → heartbeat stall detection + global watchdog
    2. Wrong error classification leading to wrong retry paths → typed DownloadErrorKind enum
    3. Unreliable resume causing corrupt files → pre-resume validation + Range-ignored detection
    4. 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
    Downloads