fix: update jsonl_file_hash on import to prevent hash mismatch warnings (bd-0vtq)
The import command was only updating jsonl_content_hash, not jsonl_file_hash. After sync imports JSONL but skips re-export (because DB matches JSONL), the jsonl_file_hash remained stale, causing validateJSONLIntegrity() to emit spurious "JSONL file hash mismatch" warnings on subsequent operations. Now import also calls SetJSONLFileHash with the same hash value, keeping both hashes in sync and eliminating the false warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -391,6 +391,13 @@ NOTE: Import requires direct database access and does not work with daemon mode.
|
||||
// is unavailable. This ensures import operations always succeed even if metadata storage fails.
|
||||
debug.Logf("Warning: failed to update jsonl_content_hash: %v", err)
|
||||
}
|
||||
// Also update jsonl_file_hash to prevent integrity check warnings (bd-0vtq)
|
||||
// validateJSONLIntegrity() compares this hash against actual JSONL content.
|
||||
// Without this, sync that imports but skips re-export leaves jsonl_file_hash stale,
|
||||
// causing spurious "hash mismatch" warnings on subsequent operations.
|
||||
if err := store.SetJSONLFileHash(ctx, currentHash); err != nil {
|
||||
debug.Logf("Warning: failed to update jsonl_file_hash: %v", err)
|
||||
}
|
||||
// Use RFC3339Nano for nanosecond precision to avoid race with file mtime (fixes #399)
|
||||
importTime := time.Now().Format(time.RFC3339Nano)
|
||||
if err := store.SetMetadata(ctx, "last_import_time", importTime); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user