fix(beads): also fix FindJSONLPath to skip deletions.jsonl (bd-tqo)
Code review follow-up: - Fix misleading docstring in FindJSONLInDir (does not return empty) - Fix same bug in beads.FindJSONLPath (also fell back to matches[0]) - Add comprehensive tests for FindJSONLPath skipping deletions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -298,7 +298,7 @@ func CheckStaleness(ctx context.Context, store storage.Storage, dbPath string) (
|
||||
// FindJSONLInDir finds the JSONL file in the given directory.
|
||||
// It prefers issues.jsonl over other .jsonl files to prevent accidentally
|
||||
// reading/writing to deletions.jsonl or merge artifacts (bd-tqo fix).
|
||||
// Returns empty string if no suitable JSONL file is found.
|
||||
// Always returns a path (defaults to issues.jsonl if nothing suitable found).
|
||||
func FindJSONLInDir(dbDir string) string {
|
||||
pattern := filepath.Join(dbDir, "*.jsonl")
|
||||
matches, err := filepath.Glob(pattern)
|
||||
|
||||
Reference in New Issue
Block a user