borg-backup-ui
borg-backup-ui copied to clipboard
Bug: Unraid dashboard widget cache can diverge from dashboard counters
Summary
The Unraid dashboard widget can diverge from the in-app dashboard even after all backups have completed.
Evidence
A reported widget-status.json generated after a successful backup contains:
- jobs.successful = 14
- jobs.running = 1
- status.state = running
- the affected job item has running = true and last_status = success with a fresh last_timestamp
- repositories shows 9/13 although the visible app state expects all repositories to be counted as online
- restore_proof shows 4/5 verified with 1 open while the in-app dashboard shows 4/4 verified and 0 open
Cause
The widget cache is written from local status evidence and must not actively probe Borg repositories from the Unraid dashboard. Several counters were still derived from slightly different internal sources than the in-app dashboard:
- Backup finalization can refresh the widget cache before the runner resource lock is released, leaving a completed job marked as running.
- Restore proof was computed from job rows instead of the same backup status rows used by the dashboard.
- Repos online counted only explicit repository info refresh success states first, and then still treated warning states as offline even though only cached error states should lower the online count.
Goal
- Clear a runtime lock from the widget cache when the latest terminal status timestamp for that job is at or after the lock start time.
- Preserve real running detection when a job started after its latest completed status.
- Compute Restore proof from the dashboard-equivalent backup rows.
- Count Repos online from cached repository data by subtracting only explicit error states.
- Add regression tests for the reported mismatches.
User impact
The Unraid dashboard widget should mirror the in-app dashboard counters after event-based cache updates without waking disks or actively probing repositories.