Skip to content

[Bug]: Due-date reminders are lost if Kaneo is down when they fall due #2286

Backlog

Description

@10vr

What happened?

If the API is not running at the moment a task's reminder falls due (a server reboot, an upgrade, a crash), that reminder is never sent, not even after the API comes back. The same goes for the overdue alert.

Why
checkDueDateReminders runs every 5 minutes and only looks back 10 minutes: REMINDER_WINDOW_MINUTES for "due soon", and a hard-coded 10 * MINUTE_MS for "overdue" (buildWindows in apps/api/src/scheduler/due-date-reminders.ts). A reminder older than that is skipped for good, so any downtime longer than about 5 to 10 minutes can lose reminders.

Suggested fix
task_reminder_sent already has a unique (task_id, reminder_type), and processReminder claims it with onConflictDoNothing. So the window start could reach much further back (for example 24 hours, or back to the last successful run) without ever sending a reminder twice. Two guards would stop it sending reminders that were never due:

  • skip a task created after its reminder moment (created_at later than the moment);
  • once a task is overdue, send only the overdue alert, not "due soon".

It would also help if a late reminder said it was delayed.

How can we reproduce it?

  1. Assign a task to someone, with a due date whose "due soon" moment (due date + 24 h − their lead time) is a few minutes away.
  2. Stop the API before that moment (docker compose stop kaneo).
  3. Start it again more than 10 minutes after the moment.
  4. No inbox notification or email arrives, and task_reminder_sent has no row for the task.

Environment

Kaneo v2.50.0, self-hosted with Docker Compose. The same code is on main today.

Activity

  1. kaneo-mellon commented on Nov 30, 2026

    @kaneo-mellon

    Thanks for contributing to Kaneo!

    We welcome AI tools for exploring ideas and writing code. Our contributing guide asks that issue, feature request, and pull request descriptions be written in your own words, so maintainers can understand your thinking.

    This submission was flagged by an automated check, which can make mistakes. If you wrote the description yourself, no changes are needed. Otherwise, please update it to explain the issue or contribution in your own voice.

    Questions? A maintainer can help.

    Automated score: 0.9898308910647285 (cutoff 0.8). Detector: 9d3abed60e628951c7b0d2cd1e1c69eddb23eb97. Model SHA-256: 228087029eceee8a1c6cd57f29ec484a0141c639f8ed139fd506ef27eaa98825.

  2. added
    mellon: review
    on Nov 30, 2026
  3. added and removed
    mellon: review
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions