fix(doctor): query metadata table instead of config for last_import_time (#916)
The sync_divergence check was querying the wrong table. The sync code writes last_import_time to the metadata table, but doctor was looking in config. This caused spurious "No last_import_time recorded" warnings even when sync was working correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -180,7 +180,7 @@ func checkSQLiteMtimeDivergence(path, beadsDir string) *SyncDivergenceIssue {
|
||||
defer db.Close()
|
||||
|
||||
var lastImportTimeStr string
|
||||
err = db.QueryRow("SELECT value FROM config WHERE key = 'last_import_time'").Scan(&lastImportTimeStr)
|
||||
err = db.QueryRow("SELECT value FROM metadata WHERE key = 'last_import_time'").Scan(&lastImportTimeStr)
|
||||
if err != nil {
|
||||
// No last_import_time recorded - this is a potential issue
|
||||
return &SyncDivergenceIssue{
|
||||
|
||||
Reference in New Issue
Block a user