fix(tags): Resolve tag deletion bug in remove-task command

Refactored the core 'removeTask' function to be fully tag-aware, preventing data corruption.

- The function now correctly reads the full tagged data structure by prioritizing '_rawTaggedData' instead of operating on a resolved single-tag view.

- All subsequent operations (task removal, dependency cleanup, file writing) now correctly reference the full multi-tag data object, preserving the integrity of 'tasks.json'.

- This resolves the critical bug where removing a task would delete all other tags.
This commit is contained in:
Eyal Toledano
2025-06-13 00:18:53 -04:00
parent 4585a6bbc7
commit b205e52d08
7 changed files with 208 additions and 191 deletions

View File

@@ -149,7 +149,7 @@ async function addDependency(tasksPath, taskId, dependencyId) {
}
// Check for circular dependencies
let dependencyChain = [formattedTaskId];
const dependencyChain = [formattedTaskId];
if (
!isCircularDependency(data.tasks, formattedDependencyId, dependencyChain)
) {