csb list shows stale data -- should auto-refresh when index is outdated
Problem
csb list reads from the SQLite index, which is only updated when csb backup runs. If the user hasn't run backup recently, list shows outdated session data (old message counts, missing new sessions, wrong timestamps).
User observed: sessions from a week ago showing as most recent, despite having active sessions right now.
Current behavior
csb list # shows data from last backup scan (could be days old)
csb backup # updates the index
csb list # now shows current data
Options
Option A: Auto-refresh on csb list
- Check if index is older than N minutes (configurable, default 15?)
- If stale, run a quick re-scan before displaying
- Pros: Always current. No extra step.
- Cons: Slower
list when stale. Mixes read and write operations.
Option B: Show staleness warning
- If last scan was > 1 hour ago, print a warning:
Index last updated 7 days ago. Run 'csb backup' to refresh.
- Pros: Fast
list. User knows data is old.
- Cons: Extra noise in output. User still has to run backup manually.
Option C: csb list --refresh
- Explicit flag to re-scan before listing
- Pros: Clear intent. Fast by default.
- Cons: Extra flag to remember.
Option D: csb list always re-scans (no separate backup step for reads)
list does a quick metadata-only scan (skip git commits)
backup does the full scan + git commit
- Pros: Always current. Clean separation.
- Cons: Slower
list (94 sessions takes ~10s to parse all JSONLs).
Recommendation
Option B + C combined: Show a staleness warning by default, offer --refresh to force update. This keeps list fast while making staleness visible.
Related
Depends on how often csb backup runs via cron. If cron runs every 15 minutes, staleness is rarely an issue. If no cron is configured, staleness is the default experience.
csb listshows stale data -- should auto-refresh when index is outdatedProblem
csb listreads from the SQLite index, which is only updated whencsb backupruns. If the user hasn't run backup recently,listshows outdated session data (old message counts, missing new sessions, wrong timestamps).User observed: sessions from a week ago showing as most recent, despite having active sessions right now.
Current behavior
Options
Option A: Auto-refresh on
csb listlistwhen stale. Mixes read and write operations.Option B: Show staleness warning
Index last updated 7 days ago. Run 'csb backup' to refresh.list. User knows data is old.Option C:
csb list --refreshOption D:
csb listalways re-scans (no separate backup step for reads)listdoes a quick metadata-only scan (skip git commits)backupdoes the full scan + git commitlist(94 sessions takes ~10s to parse all JSONLs).Recommendation
Option B + C combined: Show a staleness warning by default, offer
--refreshto force update. This keepslistfast while making staleness visible.Related
Depends on how often
csb backupruns via cron. If cron runs every 15 minutes, staleness is rarely an issue. If no cron is configured, staleness is the default experience.