Resolving to-dos nullifies their `snoozed_until` column
What does this MR do and why?
Resolving to-dos nullifies their snoozed_until column
We don't need to retain snooze data on resolved to-dos.
SQL queries
TodoService.resolve_todo
https://console.postgres.ai/gitlab/gitlab-production-main/sessions/36053/commands/111191
UPDATE
"todos"
SET
"state" = 'done',
"updated_at" = '2025-02-07 14:05:19.138128',
"resolved_by_action" = 0,
"snoozed_until" = NULL
WHERE
"todos"."id" = 22
TodoService.resolve_todos
https://console.postgres.ai/gitlab/gitlab-production-main/sessions/36053/commands/111192
UPDATE
"todos"
SET
"state" = 'done',
"resolved_by_action" = 0,
"snoozed_until" = NULL,
"updated_at" = '2025-02-07 14:10:29.056655'
WHERE (user_id = 1
AND state = 'pending')
AND "todos"."id" IN (
SELECT
"todos"."id"
FROM
"todos"
WHERE (user_id = 1
AND state = 'pending'))
AND "todos"."state" != 'done'
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Navigate to the to-dos dashboard at https://gdk.test:3443/dashboard/todos.
- Snooze some to-dos.
- Navigate to the
Snoozedtab. - Resolve some to-dos.
- Navigate to the
Donetab.- The to-do you just resolved should not have a
Snoozed until...label.
- The to-do you just resolved should not have a
Related to #17712 (closed)
Edited by Paul Gascou-Vaillancourt