fix(alarms): Kanban moves no longer re-arm due alarms of open tasks
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m0s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-10-31 10:22:36 +01:00
1 parent 21dd5e504e
commit 1b35bb3de4
6 files changed
+54 -7

No files matched your search

+5 -2
View File
@@ -243,10 +243,13 @@ func (s *Store) ReorderTasks(taskListID string, items []domain.ThoughtReorderIte
completed = append(completed, it.ID)
}
}
// Only a reopened task (done -> open) gets its due alarm again. A Kanban move sends every task
// of the touched columns, so resetting all open ones re-sent "due today" for each of them.
// (is_completed in the CASE is still the value before this UPDATE.)
_, err = tx.Exec(
`UPDATE thoughts SET sort_order = ?, kanban_status = ?, is_completed = ?,
alarm_sent = CASE WHEN ? = 0 THEN 0 ELSE alarm_sent END,
alarm_failures = CASE WHEN ? = 0 THEN 0 ELSE alarm_failures END WHERE id = ?`,
alarm_sent = CASE WHEN ? = 0 AND is_completed = 1 THEN 0 ELSE alarm_sent END,
alarm_failures = CASE WHEN ? = 0 AND is_completed = 1 THEN 0 ELSE alarm_failures END WHERE id = ?`,
it.SortOrder, *it.KanbanStatus, isCompleted, isCompleted, isCompleted, it.ID,
)
} else {