fix(api): make download_logs limit optional with sensible default

Merged
MP
6mo ago
+109-9

Summary

• download_logs IPC required limit on every call, breaking QA tooling (tauri-pilot, debug scripts, future headless adapters)
• Made limit optional with default 256 bytes (matches per-download log buffer capacity)
• Frontend always passed limit: 20, so contract was undocumented—now explicit with tests
• 2 tests lock down: default returns full 256-line buffer, explicit smaller limit trims correctly

Type

fix


Summary by cubic

Make download_logs accept an optional limit with a safe default so QA and headless clients work without extra args. Default is 256 lines, kept in sync with the per-download buffer via a shared constant; explicit limits still trim to the most recent lines.

  • Bug Fixes
    • IPC limit is now Option<usize> with DEFAULT_DOWNLOAD_LOG_LIMIT = 256 (aliased to shared DEFAULT_MAX_ENTRIES_PER_DOWNLOAD used in lib.rs to prevent drift).
    • Fixes errors when clients call without limit (e.g., tauri-pilot; vortex-qa BUG #2).
    • Added resolve_download_log_limit() and tests: default returns full buffer, explicit limit trims, resolver defaults when None, end-to-end None surfaces all lines.
    • Frontend unchanged; LogsSection.tsx still passes limit: 20.

Summary by CodeRabbit

  • New Features

    • Added a skip link to improve keyboard navigation accessibility.
  • Bug Fixes

    • Report-broken-plugin flow now handles missing repository info and shows clearer validation messages.
    • Statistics KPIs no longer show zeroed values after downloads complete.
    • Download logs endpoint accepts an optional limit and uses a sensible default when omitted.
  • Documentation

    • Updated CHANGELOG to reflect behavior changes.