Skip to content

fix(backend): cancel or re-arm a task reminder when it is checked off in a conversation - #14984

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
singhharsh1708:fix/backend-conversation-task-checkoff-reminder
Sep 20, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
singhharsh1708:fix/backend-conversation-task-checkoff-reminder

Conversation

@singhharsh1708

@singhharsh1708 singhharsh1708 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #14983

set_action_item_status (the PATCH /v1/conversations/{id}/action-items route the conversation detail page uses to check a task off) mirrored the new state onto the standalone action items but never touched their reminders. #7695 made the other completion paths call sync_action_item_reminder, so this was the one place where completing a task still left its reminder armed.

Each mirrored item now also goes through sync_action_item_reminder with its own description and due_at, so checking off cancels the reminder and unchecking a dated task schedules it again. The import is local inside the existing try, like the other local imports in this router, so a failed notification send is logged and never breaks the status update.

Two tests added to tests/unit/test_conversation_events_bounds.py. On main both fail with Expected 'mock' to be called once. Called 0 times. With the fix they pass, as does test_action_item_reminder_cancel_on_complete.py.

cd backend
python -m pytest tests/unit/test_conversation_events_bounds.py tests/unit/test_action_item_reminder_cancel_on_complete.py -q   # 19 passed
BACKEND_UNIT_TEST_FILE_LIST=<those two files> bash test.sh                                                                     # passed

Line-Count-Exception: backend/routers/conversations.py | 2249 -> 2257 | sync task reminders when a conversation task is checked off

Failure-Class: none

Review in cubic

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @singhharsh1708 — verified this closes a real gap: set_action_item_status (PATCH /v1/conversations/{id}/action-items) was the one completion path that still didn't reconcile reminders after #7695.

What I checked:

  • backend/routers/conversations.py — the new sync_action_item_reminder(...) call sits inside the pre-existing mirror try/except, structurally identical to the sibling description-update/delete mirror blocks in this file, and pulls each mirrored item's own description/due_at rather than assuming they match the conversation copy. Route contract and auth are untouched.
  • backend/utils/notifications.py (unchanged context) — sync_action_item_reminder semantics line up with the fix intent: completed or not due_at → action_item_delete data message (the client cancels the local reminder by id), open + dated → action_item_update (reschedule). _send_to_user catches its own send errors and returns 0, so a notification failure can't fail the PATCH.
  • backend/tests/unit/test_conversation_events_bounds.py — both new tests assert the full argument set in each direction (check-off → completed=True with due_at passed through; uncheck → completed=False re-arm) and fail on main with Called 0 times. Good regression coverage.

One non-blocking note: all mirrored items share the single mirror try/except, so an unexpected exception while syncing one item would skip the mark + sync of the remaining items in that request. Rare in practice since the FCM layer swallows send errors, but a per-item try would make the mirror independent per task — fine as a follow-up.

Solid, narrowly scoped fix with the right tests. Leaving the merge decision to a maintainer.

🤖 Automated review on behalf of the maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution backend Backend Task (python) labels Sep 20, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed bug still present on main, root cause explained, regression test added, CI green. 5/5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty proposal] fix(backend): checking off a task inside a conversation leaves its reminder armed ($25 proposed)

3 participants