Skip to content

[QA] HIGH: P0.4 stats record_completed never called — daily/type/avg-speed charts always empty #114

@mpiton

Description

@mpiton

Bug Report (Automated QA — vortex-qa skill)

Severity: HIGH (Phase 0 P0.4 PARTIAL completion)
View: Statistics
Commit: 86355f2
Branch: feat/task-19-notifications-enriched
tauri-pilot: 0.5.0

Steps to Reproduce

  1. Have at least one completed download in the downloads table
  2. Navigate to /statistics
  3. Observe Daily volume chart says "Not enough data to plot", Total Files = 0
  4. IPC reproduction:
    tauri-pilot ipc stats_get --args '{"period":"all"}'

Expected

totalFiles matches the count of completed downloads, daily volume chart populated.

Actual

totalFiles=0 and daily-volume aggregates empty — but the same response carries successRate=0.909 and topHosts with 4 entries (sourced from downloads table). The mismatch confirms stats_get mixes two backends.

Root cause

StatsRepository::record_completed(bytes, avg_speed) has zero non-test callers:

$ grep -rn "record_completed" src-tauri/src/
# only test files in stats_repo.rs and one mock in get_download_detail.rs

The statistics SQLite table that powers daily/type/avg-speed charts is never written. KPIs derived from downloads (success rate, top hosts) work; KPIs derived from statistics (total files, daily volume, type breakdown, average speed curve) are stuck at zero.

Fix paths

  • Wire a DownloadCompleted event handler that calls stats_repo.record_completed(bytes, avg_speed), OR
  • Reroute get_stats aggregates to read totals from downloads table for consistency.

Console errors

None — silent.

Screenshot

~/.claude/output/vortex-qa/statistics-light.png, statistics-dark.png

Environment

  • OS: Linux
  • Tauri: dev mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingqa-automatedBug found by automated QA testing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions