Reference
Quiet hours + batched notifications (P12-N)
Defer push and in-app alerts during a user-defined local quiet window. Notifications are queued and delivered as a consolidated batch when quiet hours end.
User settings
Configure in dashboard Notifications → Quiet hours:
| Field | Default | Notes |
|---|---|---|
enabled | off | Master switch |
timezone | UTC | IANA timezone (e.g. Europe/Rome) |
quietStart | 22:00 | Local time HH:MM |
quietEnd | 07:00 | Supports overnight windows (22:00→07:00) |
batchPush | on | Queue FCM + Web Push during quiet hours |
batchInApp | on | Queue in-app rows during quiet hours |
Delivery flow
sequenceDiagram
participant Msg as New message
participant Worker
participant Queue as notification_batch_queue
participant Cron as */15 cron
participant User
Msg->>Worker: mention / DM / push
Worker->>Worker: isInQuietHours?
Worker->>Queue: enqueue (push / in_app)
Cron->>Worker: flushDueNotificationBatches
Worker->>User: consolidated push + batch in-app
User->>Worker: GET /notifications
Worker->>User: auto-flush if outside quiet hoursAPI
| Method | Path | Purpose |
|---|---|---|
GET | /notifications/quiet-hours | Read prefs + pendingBatch + inQuietHours |
PATCH | /notifications/quiet-hours | Update prefs (flushes if now outside window) |
POST | /notifications/flush-batch | Manual flush (409 if still in quiet hours) |
Integration points
maybePushNotifyOnMessage— batches per-recipient pushcreateInAppNotification— batches mention/DM in-app rowsdeliverUserDigest— defers digest web push during quiet hours- Cron
*/15 * * * *—flushDueNotificationBatches GET /notifications— auto-flush when user opens inbox outside quiet hours
Migration
Apply D1 migration 0059_quiet_hours.sql.
Environment
| Variable | Default |
|---|---|
QUIET_HOURS_ENABLED | enabled (false disables batching globally) |
Wrangler
Cron trigger added: */15 * * * * for batch flush.
Daily AI digest (P12-F)
Cron-driven recap of yesterday’s chat activity: three AI-generated highlights per opted-in user, delivered via in-app notification, web push, and optional email
Room export PDF / Markdown (P12-O)
Compliance-friendly snapshots of room message history for handoff, audits, and sales demos.