forked from vhaudiquet/rhema-claw
fix(calendar): fed slots stay fed across a restart
The reminder source skipped an already-fed slot only while the slot sat in the dispatcher's pending inbox; a claw restart drained that inbox, and every future lead of the same occurrence re-fed — a reminder fired two or three times per calendar event. The source keeps its own fed-slot ledger in the calendar store now (keyed by calendar, occurrence, and lead), records each slot right after a successful ingest, and prunes rows whose occurrence is an hour past every lead, so a pruned row can never resurrect a reminder. The store-backed source's ledger survives a restart; the static-list constructor keeps an in-memory one for the process lifetime, said so in the docs that previously claimed dedup was someone else's problem. Store failures surface loudly (a silently lost row is a re-fired reminder); the prune warns and continues. Offline tests cover the once-only rule, the restart via a tempdir reopen, and the prune.
This commit is contained in:
1 parent
dad99c7664
commit
5a8be19b4c
5 files changed
+371
-40
No files matched your search
@@ -38,6 +38,11 @@ pub enum CalendarError {
|
||||
/// than poll an under-specified feed.
|
||||
#[error("calendar config: {0}")]
|
||||
Config(String),
|
||||
/// The calendar store failed to open, migrate, or answer: a lost
|
||||
/// fed-slot ledger row is a re-fired reminder, so this surfaces
|
||||
/// instead of shrinking the ledger silently.
|
||||
#[error("calendar store: {0}")]
|
||||
Store(String),
|
||||
}
|
||||
|
||||
/// The longest body snippet an [`CalendarError::Api`] keeps: enough for
|
||||
|
||||
Reference in new issue
Block a user