tududi/backend/modules/tasks
Chris 402d5b05e1
Fix Today page task completion issues (#970)
* Fix Today page task completion issues

- Fix completed task border color staying as priority color
  - Add isInCompletedSection prop to TaskItem for explicit completed state
  - Tasks in completed section now always show green border regardless of priority
  - Fixes race condition where status wasn't updated during optimistic UI update

- Fix completed task reappearing after unmarking and page refresh
  - Add defensive check in backend to force clear completed_at when status is not DONE
  - Add development logging in tasksService for debugging completion toggle
  - Ensures database state is consistent even if handleCompletionStatus doesn't clear it

- Update TaskList and TasksToday components to pass isInCompletedSection prop
  - Explicitly marks tasks rendered in the completed section
  - Prevents border color flickering during state transitions

* Add comprehensive logging to debug completion issues

* Fix duplicate API requests causing completion state issues

- Separate state update logic from API call in handleTaskUpdate
- Create new updateTaskInState function for state-only updates
- Pass onTaskCompletionToggle to completed section to avoid duplicate calls
- This fixes the persistence issue where unmarked tasks came back after refresh
- Completion toggles now only make ONE API call instead of two

* Add debug logging to updateTaskInState
2026-03-24 16:45:31 +02:00
..
core Fix recurring task initial due date calculation to match recurrence pattern (#965) 2026-03-23 18:24:54 +02:00
middleware Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
operations Fix Today page task completion issues (#970) 2026-03-24 16:45:31 +02:00
queries Fix subtask ordering to prevent random reordering (#930) 2026-03-10 00:17:26 +02:00
utils Fix defer date validation for recurring task instances (#910) 2026-03-05 08:20:30 +02:00
attachments.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
deferredTaskService.js Fix Telegram notification spam with channel-level rate limiting (#951) 2026-03-19 20:26:11 +02:00
dueTaskService.js Fix Telegram notification spam with channel-level rate limiting (#951) 2026-03-19 20:26:11 +02:00
events.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
index.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
recurringTaskService.js Fix bi-weekly+ recurring tasks reverting to weekly (#844) (#890) 2026-03-02 23:36:47 +02:00
repository.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
routes.js Fix Today page task completion issues (#970) 2026-03-24 16:45:31 +02:00
taskEventService.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
taskScheduler.js Fix issue with wrong path 2026-01-18 09:47:12 +02:00
taskSummaryService.js Fix Telegram task display bug by escaping backslashes (#860) 2026-02-24 14:19:45 +02:00