Title: Persist last-good remote-state across refresh wipes so a single bad pass doesn't blank the dashboard #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-15T03:18:31Z - https://github.com/coilysiren/repo-recall/issues/166
Problem
CacheDb::open_in_dir deletes the prior cache.redb on startup, and every refresh starts with wipe() to truncate every table (per AGENTS.md: "the cache is wipe-on-restart"). When a refresh pass fails to reach gh (down or rate-limited), all remote-state columns blank out across the dashboard, even though we had perfectly good data 2.5 minutes ago. A single bad pass erases the whole remote view.
Where
src/db.rs - wipe-on-startup + per-refresh wipe() design.
src/display/routes/refresh.rs - remote-state pass writes blanks on failure rather than preserving prior values.
Proposed
Carry last-good remote-state across refresh passes. Two viable shapes:
In-memory shadow keyed by repo_id that the writer falls back to when the new pass returns no value.
Soft-update for remote columns only: skip the column-wipe step in wipe() for RemoteState attributes, then overwrite-on-success rather than wipe-then-fill.
Pair with an "as of" timestamp per remote column so stale values render with a freshness pill instead of being indistinguishable from current ones.