Prevent empty Unraid widget status scans from overwriting fresh cache
The Unraid dashboard widget cache can be written with cache_state=fresh even when the status scan returned no backup rows while jobs are known. This produces a filled widget-status.json with job metadata but empty last_status/last_timestamp fields and zero backup counters.
Goal:
- Do not treat a fresh widget cache with enabled jobs but no backup status evidence as usable.
- Do not overwrite an existing useful widget cache with an empty status-file scan.
- Fall back to an initial/stale startup cache when no backup status evidence is available.
- Add regression coverage for the empty status scan case.
User impact: Prevents the Unraid dashboard widget from showing OK / No backup / 0 successful after startup or update when the status scan could not read usable backup status rows.
Reopening because the dashboard widget cache can still become stale after successful backup jobs. The follow-up fix will be handled in PR #437 together with the current test-channel candidate.
Implemented a follow-up fix in PR #437 and published it to the test channel as 2026.08.28.1932.
What changed:
- Backup finalization now refreshes the Unraid dashboard widget cache after the normal status file has been persisted.
- The widget status importer now works with both runtime import layouts used by the app server and job runner processes.
- A stale cache that only contains a running job without completed backup status evidence is no longer treated as usable fresh data, so startup can rebuild it from status files.
This keeps the widget event-based and avoids reintroducing periodic dashboard scans. Please test with the new test-channel build and check whether the Based on timestamp advances after the next completed backup.
Follow-up update: test-channel version 2026.08.28.1940 removes the duplicate widget refresh log line. The cache refresh now happens only from backup finalization after status persistence and lock release.