fix(daemon): include tombstones in exportToJSONLWithStore for sync propagation (#696)
* fix(daemon): include tombstones in exportToJSONLWithStore for sync propagation The daemon's exportToJSONLWithStore() function was using an empty IssueFilter which defaults to IncludeTombstones: false. This caused deleted issues (tombstones) to be excluded from JSONL exports during daemon sync cycles. Bug scenario: 1. User runs `bd delete <issue>` with daemon active 2. Database correctly marks issue as tombstone 3. Main .beads/issues.jsonl correctly shows status:"tombstone" 4. But sync branch worktree JSONL still showed status:"open" 5. Other clones would not see the deletion The fix adds IncludeTombstones: true to match the behavior of exportToJSONL() in sync.go, ensuring tombstones propagate to other clones and prevent resurrection of deleted issues. Adds regression test TestExportToJSONLWithStore_IncludesTombstones that verifies tombstones are included in daemon JSONL exports. * fix: resolve all golangci-lint errors (cherry-pick from fix/linting-errors) Cherry-picked linting fixes to ensure CI passes. --------- Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
This commit is contained in:
@@ -36,8 +36,9 @@ func exportToJSONLWithStore(ctx context.Context, store storage.Storage, jsonlPat
|
||||
}
|
||||
|
||||
// Single-repo mode - use existing logic
|
||||
// Get all issues
|
||||
issues, err := store.SearchIssues(ctx, "", types.IssueFilter{})
|
||||
// Get all issues including tombstones for sync propagation (bd-rp4o fix)
|
||||
// Tombstones must be exported so they propagate to other clones and prevent resurrection
|
||||
issues, err := store.SearchIssues(ctx, "", types.IssueFilter{IncludeTombstones: true})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get issues: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user