Fix bd-47f1: bd import now flushes JSONL immediately for daemon visibility

- Changed bd import to call flushToJSONL() instead of markDirtyAndScheduleFlush()
- Ensures daemon FileWatcher detects changes within ~500ms instead of up to 30s
- Fixes race condition where MCP daemon served stale data after CLI import
This commit is contained in:
Steve Yegge
2025-11-02 15:47:45 -08:00
parent 18bd4f9630
commit 8a04cd3382

View File

@@ -176,8 +176,9 @@ Behavior:
fmt.Fprintf(os.Stderr, "\nAll text and dependency references have been updated.\n")
}
// Schedule auto-flush after import completes
markDirtyAndScheduleFlush()
// Flush immediately after import (no debounce) to ensure daemon sees changes
// Without this, daemon FileWatcher won't detect the import for up to 30s
flushToJSONL()
// Print summary
fmt.Fprintf(os.Stderr, "Import complete: %d created, %d updated", result.Created, result.Updated)