You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tracking: warn_if_missing_table's self-heal hint isn't wired into rtk gain's read paths #3685
Found by `/code-review max` while iterating on #3206 (pre-existing gap, unrelated to that PR's `hook_decisions` feature — flagged separately rather than folded in).
`core::tracking::warn_if_missing_table` — "tracking database looks corrupted ({context}: {err}). Run `rtk init` to recreate it." — is only wired into 3 write paths (`record`, `record_parse_failure`, `record_hook_decision`) plus the 2 `discover` read paths added by #3206. None of `Tracker`'s other read methods that back plain `rtk gain` (`get_recent`, `get_summary`, `get_all_days`, `get_by_week`, `get_by_month`, `get_parse_failure_summary`) call it.
If a table is dropped/corrupted out-of-band after `user_version` is already current (the exact scenario this hint exists for), plain `rtk gain` — the single most common analytics command — fails with a raw `no such table: commands` rusqlite error instead of the friendly self-heal hint every write path (and now the `discover` reads) already give for the identical failure class.
Likely fix: route those read methods' `no such table` errors through `warn_if_missing_table` too (or a variant that returns the hint as part of the error message rather than just `eprintln!`ing, since these are read paths whose callers may want to display it differently than a write path's fire-and-forget warning).
warn_if_missing_table's self-heal hint isn't wired into rtk gain's read paths (get_recent, get_summary, get_all_days, get_by_week, get_by_month, get_parse_failure_summary), so a corrupted tracking table surfaces a raw rusqlite error instead of the friendly 'run rtk init' hint; route these read methods through warn_if_missing_table or an equivalent that returns the hint in the error message.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/core/tracking.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
pszymkowiak commentedon Aug 23, 2026
🔍 Automated Triage
bugmediumSummary
warn_if_missing_table's self-heal hint isn't wired into rtk gain's read paths (get_recent, get_summary, get_all_days, get_by_week, get_by_month, get_parse_failure_summary), so a corrupted tracking table surfaces a raw rusqlite error instead of the friendly 'run rtk init' hint; route these read methods through warn_if_missing_table or an equivalent that returns the hint in the error message.
📁 Relevant files
src/core/tracking.rsTriaged automatically by wshm · This is an automated analysis, not a human review.