Title: Persist last-good remote-state across refresh wipes so a single bad pass doesn't blank the dashboard #35

Open
opened 2026-05-23 20:55:25 +00:00 by coilysiren · 0 comments
Owner

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.

_Originally filed by @coilysiren on 2026-05-15T03:18:31Z - [https://github.com/coilysiren/repo-recall/issues/166](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.
coilysiren added
P3
and removed
P2
labels 2026-05-31 07:01:14 +00:00
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/repo-recall#35
No description provided.