Repository navigation
Description
Problem
Ruby reminders already cover one-shot and recurring schedules, missed: :latest and missed: :all, cancellation, and inspection. Three parts of that surface are still missing. They are the Ruby counterpart of the remaining work on solid-objects-js#37.
On origin/main (80523e7):
- There is no
skipmissed-run policy.scheduleraises unlessmissedisallorlatest, and the reminders table check allows only'latest'and'all'. ReminderStatushasoccurrence,status, andnext_run_at. It does not have last run. The reminders table has no last-run column.ReminderStatushas no failure information. The reminders table allowsstatus'paused', but nothing writes it. If the scheduler cannot enqueue because the operation is unknown, it raisesUnknownMessage, releases the claim, and leaves the reminderscheduled.
Proposed API
Keep the public names latest and all. Add skip. Do not rename. Document that latest coalesces missed occurrences (the JS PRD's run_once) and all enqueues each missed occurrence (the JS PRD's catch_up). Default when missed is omitted stays latest. schedule accepts missed: :skip or "skip". Adding skip also changes the reminders missed_policy check constraint.
reminder and reminders stay a read. They still include this turn's staged intents. Add two fields to ReminderStatus:
last_run_at, ornilif the reminder has never been enqueued. This is the time the runtime last enqueued the reminder as a mailbox message, not when that operation finished. The reminders table does not store it today.error_class, ornil, the error class that paused the reminder. Mailbox retries and dead letters stay on the message. Do not put the mailbox retry count onReminderStatus.
occurrence stays as it is. It is the number of times this reminder has been enqueued.
Semantics
skip. Askipmissed-run policy drops missed occurrences and waits for the next scheduled time.- On replace. Keep
last_run_atandoccurrence, and clearerror_class. Today a replace already keepsoccurrenceand setsstatusto"scheduled". - Pause on unknown operation at fire. When the scheduler cannot enqueue because the operation is unknown, pause the reminder and record
error_class. Do not leave the reminderscheduled. Mailbox failure of an already enqueued occurrence does not pause the reminder. Retries and dead letters stay on the message. This issue does not add a resume API. - Fire authorization. A fired reminder stays an internal mailbox message. Internal deliveries do not call
authorize_message, asdocs/authorization.mdalready says. An external enqueue of the same operation still goes throughauthorize_message. - Timing contract. Document what the code does today. Do not invent a time zone or clock-skew guarantee.
schedule(at:)storesatasnext_run_at. The scheduler treats a reminder as due whennext_run_atis on or before the testnowif one is passed, otherwisedatabase_now, which reads the database clock and converts that value to UTC. Retry and retention of a fired reminder follow the mailbox message it enqueued. Time zone and clock skew are not a documented guarantee in the Ruby docs today.
Acceptance
Cover create, replace, cancel, recurring execution, the missed-run policies latest, all, and skip, actor-facing last_run_at, occurrence, and error_class (a replace keeps the first two and clears error_class), that an unknown operation at fire pauses the reminder and records error_class, restart recovery, that a fired reminder still runs when authorize_message returns false while an external enqueue of the same operation still goes through authorize_message, and duplicate delivery.
Ruby has one runtime, not the JS SQL and Durable Objects adapters. This is not a second copy of the JS conformance suite.
Not planned
- A distinct
reschedulemethod. Scheduling an existing name already replaces its next occurrence. Reopen if the ergonomics prove otherwise. - A return value from
unschedule/unschedule_allthat reports whether a schedule was removed. Cancellation stays an intent that returnsnil, matching OrleansUnregisterReminderand Durable ObjectsdeleteAlarm. Whether an alarm is present is answered byreminder/reminders, which already include this turn's staged intents. Reopen if a caller cannot get that answer from the read.
Already on main
On origin/main (80523e7):
schedule(at:, every:, missed:, key:)returns a durable handle.missedislatestorall.- A name identifies at most one active schedule per actor. Scheduling an existing name replaces it. A replace keeps
occurrence. - One-shot and recurring schedules, cancellable by operation, by key, or by handle.
unscheduleandunschedule_allreturnnil. ReminderStatusalready hasname,operation,key,next_run_at,interval_seconds,missed_policy,occurrence,status, andhandle.- A fired reminder enqueues an internal mailbox message with idempotency key
reminder:<id>:<occurrence>, so it inherits mailbox ordering, retry, dead letters, and deduplication. Internal delivery does not callauthorize_message. - The scheduler claims due
scheduledreminders, including a reminder whose claim owner is gone. docs/reminders.mdalready saysreminderandremindersinclude the current turn's staged changes.docs/authorization.mdalready says internal reminder deliveries do not re-enter the public client policy.
JavaScript counterpart
solid-objects-js#37 is the JS remaining-work issue. This issue is the Ruby counterpart of that remaining work, in Ruby names (ReminderStatus, last_run_at, error_class, Time). It is not a line-by-line port.
Activity
Reminders: skip missed policy, last_run_at and error_class, pause on …
cardmagic commentedon Dec 2, 2026
Completed by #110, shipped in v1.1.0.