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:
aaron-sangster
2026-01-06 03:11:17 +00:00
committed by GitHub
parent 7db052a48e
commit b86ce0a7e0
2 changed files with 48 additions and 7 deletions

View File

@@ -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{