Skip to content

Notifications and preferences ​

Who: listener; system (every module sends through the Notifier port).

Entry points ​

KindEntry
RESTGET /notifications, GET /notifications/badge, POST /notifications/read-all, POST /notifications/:id/read, /unread, /open, DELETE /notifications/:id
PreferencesGET/PUT /notifications/preferences, GET/PATCH /notifications/settings (quiet hours, time zone)
DevicesPUT /me/devices/current/tokens (FCM, APNs, VoIP)
Socket /notifybadge:get, notification:read, notification:open, notifications:read_all; server → notification:created, notification:updated, notification:removed, badge:updated
Deep linknotifications; every item carries its own deepLink

Flow ​

  1. A module calls notify(request, tx) with a catalogue type. The request commits with the caller's transaction (unknown type → NOTIFICATION_TYPE_UNKNOWN thrown in that transaction).
  2. Audience users writes inbox items at once; audience followers is expanded in batches by notifications.expand.
  3. Each recipient: in-app item stored (collapse key replaces unread items) → notification:created + badge:updated on /notify.
  4. Push and email are filtered by preferences, consent (marketing), quiet hours (held or dropped), per-category daily caps; critical (call.incoming, security, receipts) bypasses them. Queues notify-critical and notify-bulk.
  5. notifications.sweep retries stuck deliveries; notifications.maintenance prunes. notifications.engagement runs re-engagement campaigns when its port is wired.
  6. Open → POST /notifications/:id/open → event notifications.notification.opened; the app opens deepLink.

Exit states ​

StateCodeActionsClient next
Read / opened——Update badge
Unknown itemNOTIFICATION_NOT_FOUND—Remove locally
Locked channelNOTIFICATION_CHANNEL_LOCKED—Show it as always on
Unknown typeNOTIFICATION_TYPE_UNKNOWN—Refresh preferences
Quiet hoursNOTIFICATION_QUIET_HOURS_INVALID——
Push providerNOTIFICATION_PUSH_UNAVAILABLEretry—

Known gaps ​

  • Engagement notifications (continue listening, weekly mix, new for you, digest, streak, we miss you) are never sent: no engagement port is passed (I6).
  • Seeded but never sent: social.followed, social.liked, social.mentioned, playlist.collab_requested, playlist.collab_accepted, payment.failed, wallet.topup_succeeded, mart.purchase_completed, mart.sale_made, release.approved, security.new_sign_in (I1, I3, I5, M5).
  • Sent but not seeded: distribution.earnings_held, distribution.earnings_released (B1).
  • No deep-link screen for notification settings (M7); notifications.notification.opened has no consumer (M14).

Plemuz API v2