Skip to content

fix: keep distinct nearby cron reminders #161

Description

@louiseboo

Summary

CronService.add_job treats any enabled job for the same channel and recipient as a duplicate when its next fire is within 15 minutes, even when the messages and topics are different. The second reminder is silently dropped because the existing job is returned.

Steps to reproduce

  1. Create a CronService with an empty store.
  2. Add a one-shot reminder with message prepare the daily brief.
  3. Add another one-shot reminder for the same channel and recipient 10 minutes later with message review the presentation.
  4. Compare the returned job IDs and list the stored jobs.

The second call returns the first job ID and only one job is stored.

Expected behavior

Different reminder content should create distinct jobs even when fire times are close. Deduplication should rely on an explicit shared topic_tag, a byte-identical message, or an identical recurring schedule.

Actual behavior

The cross-kind 15-minute time-window rule returns the existing job without comparing message content or topic identity. This can drop a legitimate reminder with no user-visible indication that a different task was retained.

Environment

  • OS: macOS
  • Shell: zsh
  • Python: 3.13.14
  • Installation: source checkout with uv
  • Raven: v0.1.6 and main at f2b37c6

Logs or screenshots

Cron: skipped duplicate add - existing job fires within 15min of new request (same channel/to, kinds=at/at)

Additional context

The existing topic_tag and byte-identical message checks provide explicit identity signals. Removing the time-only heuristic preserves those safeguards while allowing adjacent independent reminders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions