fix: handle deleted tasks in todo-sync (Cubic feedback)

- When task is deleted (syncTaskToTodo returns null), filter by content

- Prevents stale todos from remaining after task deletion
This commit is contained in:
YeonGyu-Kim
2026-02-14 19:02:30 +09:00
parent 4b2410d0a2
commit 02e0534615

View File

@@ -108,7 +108,11 @@ export async function syncTaskTodoUpdate(
});
const currentTodos = extractTodos(response);
const taskTodo = syncTaskToTodo(task);
const nextTodos = currentTodos.filter((todo) => !taskTodo || !todosMatch(todo, taskTodo));
const nextTodos = currentTodos.filter((todo) =>
taskTodo
? !todosMatch(todo, taskTodo)
: todo.content !== task.subject
);
const todo = taskTodo;
if (todo) {