Outbreak digest mode (batch notifications on high-activity days) #76

Closed
opened 2026-07-18 05:31:38 +00:00 by claude-bot · 1 comment
Contributor

On high-activity days the current design can send dozens of per-alert messages per channel; a per-subscription "digest above N alerts/hour" batching option. Real value, but interacts with F-11's delivery redesign — sequence after it. Effort M.


Filed from the 2026-07-17 codebase audit (docs/.internal/report-2026-07-17.md), finding I-06.

On high-activity days the current design can send dozens of per-alert messages per channel; a per-subscription "digest above N alerts/hour" batching option. Real value, but interacts with F-11's delivery redesign — sequence after it. Effort M. --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding I-06._
Author
Contributor

Done in #116 (merged). Per-subscription opt-in digest_threshold (null = off, default): once a (channel, location) sub has sent that many alerts within DIGEST_WINDOW_MINUTES (60), further advisory/watch alerts are batched and delivered as one periodic digest by a flush_alert_digests job every DIGEST_FLUSH_MINUTES (30). The digest is a synthetic "Weather Alert Digest" NWSAlert dispatched through the existing per-notifier send path (no new per-notifier code), double-send-safe (pending flag cleared atomically with a kind="digest" ledger row the outbox never re-drives), quiet-hours-aware, fail-soft per group.

Safety decision: warning-class alerts are never batched — they always dispatch immediately (holding a life-safety warning up to the flush interval is unacceptable, and an operator taming advisory spam wouldn't expect it). Only advisories/watches digest. If you'd prefer everything batched during an outbreak instead, it's a one-line change. Migration 0028; 7 tests (incl. test_warning_class_never_defers); bulk 746 passed.

Done in #116 (merged). Per-subscription opt-in `digest_threshold` (null = off, default): once a (channel, location) sub has sent that many alerts within `DIGEST_WINDOW_MINUTES` (60), further **advisory/watch** alerts are batched and delivered as one periodic digest by a `flush_alert_digests` job every `DIGEST_FLUSH_MINUTES` (30). The digest is a synthetic "Weather Alert Digest" `NWSAlert` dispatched through the existing per-notifier send path (no new per-notifier code), double-send-safe (pending flag cleared atomically with a `kind="digest"` ledger row the outbox never re-drives), quiet-hours-aware, fail-soft per group. **Safety decision:** warning-class alerts are **never** batched — they always dispatch immediately (holding a life-safety warning up to the flush interval is unacceptable, and an operator taming advisory spam wouldn't expect it). Only advisories/watches digest. If you'd prefer everything batched during an outbreak instead, it's a one-line change. Migration 0028; 7 tests (incl. `test_warning_class_never_defers`); bulk 746 passed.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot#76
No description provided.