Skip to content

Delivered cron reminders are sent twice via heartbeat wake #164

Description

@louiseboo

Summary

When a user-facing Cron job succeeds with payload.deliver=true, Raven first delivers the generated reply through the hub or broadcast path. The same successful reply is then enqueued by _emit_cron_event and wakes Heartbeat, which can deliver it to the user a second time.

Steps to reproduce

  1. Run the Raven gateway with Cron and Heartbeat event wake enabled.
  2. Schedule a one-shot Cron reminder with deliver=true to a real channel.
  3. Let the job fire successfully.
  4. Observe the direct Cron delivery, followed by a second delivery from Heartbeat for the same job.

Expected behavior

A successful user-facing Cron job is delivered exactly once. Successful silent jobs may still wake Heartbeat, and failed jobs must still enqueue a failure event and wake Heartbeat.

Actual behavior

The same scheduled reminder is delivered once by the Cron hub/broadcast path and then again after the successful Cron result wakes Heartbeat.

Environment

OS: macOS 26.5.2
Shell: zsh
Python: 3.12.13
Installation: uv tool
Raven: main at f2b37c6 (runtime version 0.1.3)

Logs or screenshots

Sanitized event sequence:


08:50:10 Cron response delivered
08:50:10 Heartbeat checking for tasks (reason: cron:<job-id>)
08:50:54 Heartbeat delivered the same reminder


No private reminder content or recipient identifiers are included.

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