Skip to content

fix: preserve indexed snapshots in dashboard history - #1308

Open
floze-the-genius wants to merge 1 commit into
garethgeorge:mainfrom
floze-the-genius:fix/dashboard-indexed-snapshot-history
Open

fix: preserve indexed snapshots in dashboard history#1308
floze-the-genius wants to merge 1 commit into
garethgeorge:mainfrom
floze-the-genius:fix/dashboard-indexed-snapshot-history

Conversation

@floze-the-genius

Copy link
Copy Markdown

Fixes #1307.

Summary

  • use live indexed snapshots as fallback evidence for dashboard history when the matching backup operation is no longer present
  • deduplicate fallback snapshots against backup operations by snapshot ID
  • exclude forgotten snapshots while preserving per-day byte details and overdue tracking

Tests

  • go test ./internal/api -count=1
  • go test ./internal/orchestrator/tasks -count=1
  • go vet ./internal/api
  • go test ./... -count=1 (with the CI-style fake webui/dist/index.html.gz embed)

@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@garethgeorge

Copy link
Copy Markdown
Owner

Hi, thanks for the interest in contributing -- would you mind including some screenshots / explaining a in a bit more detail the problem you're seeing and how this CL is addressing it?

@garethgeorge

garethgeorge commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Okay looking deeper -- seeing a few lingering issues:

  • The history strip gets fixed but the counters next to it don't -- the fallback never updates backupsSuccess30, backupsExamined, the byte totals, protectedBytes, or backupChart. Those all render on the same card (SummaryDashboard.tsx:596-623, and :179-190 where the status dot is derived from recentBackups), so in the case this is meant to fix you'd see green days sitting above "0 ok" with an idle dot.
  • Both new maps hold every snapshot in the oplog, and twice over since each one goes into the plan acc -- this is quite a bit of memory and needs to be avoided. The start time of a snapshot will always be after the time the backup operation ran, and will be somewhat close, we should be able to do something more clever here.
  • nit: applyIndexedSnapshotFallbacks mutates state from inside finalize, so calling finalize twice would double count. Probably cleaner to call it once at the end of the walk.

@floze-the-genius
floze-the-genius force-pushed the fix/dashboard-indexed-snapshot-history branch from f1a5880 to f7b7704 Compare July 29, 2026 08:57
@floze-the-genius

Copy link
Copy Markdown
Author

Updated the implementation in f7b7704 to cover the remaining dashboard state:

  • indexed-snapshot fallbacks now update success/examined counts, byte totals and averages, protectedBytes, daily history, staleness evidence, and backupChart through the same accounting path;
  • the newest-first oplog walk retains at most one unmatched indexed snapshot per plan instead of maps containing every snapshot;
  • pending fallbacks are emitted in newest-first order;
  • fallback application now runs once after the oplog walk, outside finalize, so repeated finalization does not double-count.

Added coverage for counters, bytes, chart entries, deduplication, forgotten snapshots, ordering, and repeated finalization. Validation: go test ./internal/api -count=1, go test ./internal/orchestrator/tasks -count=1, and go vet ./internal/api.

@floze-the-genius

Copy link
Copy Markdown
Author

Controlled local before/after reproduction, using the same config and operation log for both binaries. The fixture contains three successful OperationIndexSnapshot records (4, 2, and 0 days ago) and no OperationBackup records.

Base 148ba12c: the dashboard ignores those live indexed snapshots and renders the empty state.

Base dashboard: Waiting for first backup

PR head f7b7704a: the same data renders Everything is backed up, three successful history days, Protected 300 MiB, and Last upload 30 MiB.

PR dashboard: indexed snapshot history restored

This verifies that the fallback now feeds the complete dashboard accounting path rather than only coloring the history strip. Validation on the PR head: go test ./internal/api and pnpm run build.

@floze-the-genius

Copy link
Copy Markdown
Author

Hi @garethgeorge — following up on the requested changes: f7b7704 addresses the dashboard counters, chart, and staleness path; bounds indexed-snapshot retention; and moves fallback application out of finalize. The controlled before/after reproduction is above, and the branch is still current with main. Is there anything else you would like changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard missing snapshots for one repo

3 participants