fix: bd delete --cascade now recursively deletes dependents (#787)

The --cascade flag was documented but not working for single-issue
deletes. The bug had two causes:

1. CLI direct mode: Single-issue deletes bypassed the batch path where
   cascade expansion actually happens. Fixed by routing cascade deletes
   through deleteBatch() regardless of issue count.

2. Daemon/RPC mode: handleDelete() iterated through IDs individually
   without expanding dependents. Fixed by using DeleteIssues() with
   cascade flag when SQLite storage is available.

Now `bd delete <id> --cascade --force` correctly deletes the target
issue plus all issues that depend on it (recursively).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-29 15:10:46 -08:00
parent 05c8bbe4f9
commit 1256352d49
2 changed files with 57 additions and 2 deletions

View File

@@ -167,7 +167,8 @@ the issues will not resurrect from remote branches.`,
}
// Handle batch deletion in direct mode
if len(issueIDs) > 1 {
// Also use batch path for cascade (which needs to expand dependents)
if len(issueIDs) > 1 || cascade {
deleteBatch(cmd, issueIDs, force, dryRun, cascade, jsonOutput, hardDelete, reason)
return
}