Appearance
Notifications and preferences
Who: listener; system (every module sends through the Notifier port).
Entry points
| Kind | Entry |
|---|---|
| REST | GET /notifications, GET /notifications/badge, POST /notifications/read-all, POST /notifications/:id/read, /unread, /open, DELETE /notifications/:id |
| Preferences | GET/PUT /notifications/preferences, GET/PATCH /notifications/settings (quiet hours, time zone) |
| Devices | PUT /me/devices/current/tokens (FCM, APNs, VoIP) |
Socket /notify | badge:get, notification:read, notification:open, notifications:read_all; server → notification:created, notification:updated, notification:removed, badge:updated |
| Deep link | notifications; every item carries its own deepLink |
Flow
- A module calls
notify(request, tx)with a cataloguetype. The request commits with the caller's transaction (unknown type →NOTIFICATION_TYPE_UNKNOWNthrown in that transaction). - Audience
userswrites inbox items at once; audiencefollowersis expanded in batches bynotifications.expand. - Each recipient: in-app item stored (collapse key replaces unread items) →
notification:created+badge:updatedon/notify. - 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. Queuesnotify-criticalandnotify-bulk. notifications.sweepretries stuck deliveries;notifications.maintenanceprunes.notifications.engagementruns re-engagement campaigns when its port is wired.- Open →
POST /notifications/:id/open→ eventnotifications.notification.opened; the app opensdeepLink.
Exit states
| State | Code | Actions | Client next |
|---|---|---|---|
| Read / opened | — | — | Update badge |
| Unknown item | NOTIFICATION_NOT_FOUND | — | Remove locally |
| Locked channel | NOTIFICATION_CHANNEL_LOCKED | — | Show it as always on |
| Unknown type | NOTIFICATION_TYPE_UNKNOWN | — | Refresh preferences |
| Quiet hours | NOTIFICATION_QUIET_HOURS_INVALID | — | — |
| Push provider | NOTIFICATION_PUSH_UNAVAILABLE | retry | — |
Known gaps
- Engagement notifications (continue listening, weekly mix, new for you, digest, streak, we miss you) are never sent: no
engagementport 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.openedhas no consumer (M14).