Skip to main content

Notifications and operational channels

Imported component documentation. Source: melodee-project/melodee-api at commit 0267c458207082337d9baf1130deeb65f43c9d4a. Version 1.0.1. License MIT. Status: implemented-and-automatically-verified candidate; not published, deployed or production-qualified. This is the component's committed documentation, not proof of a distribution release or production qualification.

Operational notifications are sanitized summaries, never raw provider output, credentials, private listener state or protected paths. Events are stored as scalar evidence in PostgreSQL; delivery rows are bounded and retried; no binary payload is stored.

Channels​

ChannelRoutingRequirements
in_appper account, listed at GET /api/v1/notificationsinteractive session
emailper account, sent to the account's first verified contactverified contact + configured SMTP relay
telegramone configured operational chat (MELODEE_TELEGRAM_*)bot token + chat id

Webhooks, Discord and mobile push remain backlog and are not advertised.

Subscriptions​

GET|PUT /api/v1/auth/notification-subscriptions replaces the caller's complete subscription set (interactive sessions only; automation credentials cannot manage notifications). Each subscription is:

{
"channel": "in_app",
"minimumSeverity": "warning",
"enabled": true,
"eventKinds": ["job.failure", "storage.capacity"]
}
  • minimumSeverity filters info < warning < critical.
  • An empty eventKinds list means every event; otherwise only listed kinds are delivered (at most 50, from the published event registry).
  • At most one subscription per channel, three in total.
  • Telegram is a single configured operational chat; per-account Telegram routing is not supported. Subscribing a channel does not bypass the global delay/rate limit.

Event kinds are published in notify::EVENT_KINDS and include test, job.failure, ingestion/normalize failures, storage unavailability/capacity, quarantine/review backlogs, provider circuit open/recovered, backup failure and notifications.recovered.

Inbox​

  • GET /api/v1/notifications?limit=&unreadOnly= — newest first, sanitized fields, occurrence count and read state.
  • PUT /api/v1/notifications/{id}/read — one notification; 404 when unknown, already read or not the caller's.
  • PUT /api/v1/notifications/read-all — returns the updated count.

Deduplicated events aggregate into one row per recipient/channel: the occurrence count increases, the summary is refreshed and a re-occurrence clears the read state.

Delivery semantics and recovery​

  • Deduplication uses the event dedupe key scoped to channel and recipient, so a retry or repeated failure does not flood the inbox.
  • Telegram delivery reuses the bounded queue: 20 rows per tick, per-minute cap, transient retry with bounded backoff and max_attempts.
  • Email queues at most 10 rows per tick, 30 sent per minute, the same bounded retry/backoff, and records channel_unconfigured or no_verified_contact as an explicit failure instead of silently dropping the notification.
  • On worker start, interrupted sending rows return to queued; a notifications.recovered warning (aggregated per day) is published when any were recovered.
  • GET /api/v1/admin/notifications exposes recent delivery rows (channel, occurrence count, state, attempts, last error class) to operations.read automation or the admin_jobs capability.

Controlled testing​

Tests never send real messages. The automated suite publishes events directly to a disposable database, exercises subscription validation, severity/allowlist filtering, aggregation, read state, truthful email failure classes and automation denial. A controlled loopback SMTP relay can qualify successful email delivery without contacting an external provider; a real Telegram bot, real SMTP provider and installed app notifications remain external qualification.