Expand description
Notifications and watch lists.
Services create notifications inside the transaction of the event that
causes them (a change is submitted, a reviewer decides, a dependent is
flagged, …), so they exist exactly when the event happened. Each user sees
them in the web UI (bell and page), through the API and in the desktop
app; e-mail and Mattermost delivery read the same rows as an outbox
(crate::delivery). Users mute kinds and switch channels off on their
account page. The actor of an event is never notified about it.
Who is notified:
| Event | Recipients |
|---|---|
| change submitted | reviewers (review request), watchers of the change |
| reviewer decides, change released / rejected / withdrawn / cancelled | author, reviewers, watchers of the change |
| revision released, revised, made obsolete, checked in | watchers of the item |
| dependent flagged (change propagation) | creator of the dependent, author of its latest revision, its watchers |
| check-out released by somebody else | the holder of the lock |
| change request raised | CAD editors of the affected project groups, watchers of the affected items |
| change request triaged, assigned, commented, decided, implemented | requester, assignee, commenters, watchers of the request |
periodic digest of the requests waiting for triage (request_digests) | CAD editors of the project group, e-mail only |
Creating an item makes its creator a watcher.
Structs§
- Notice
- The content of a notification.
- Notification
- Settings
- Settings
Update - Watched
- What a user watches, for the notifications page and the API.
Enums§
- Subject
- What a notification is about. Recipients who may not read the subject
are left out (
notify), so a notification never carries data of a restricted project group to outsiders.
Functions§
- generic_
text_ sql - SQL expression: the notification aliased
nis about a group that switchednotification_contentoff (need-to-know, #151): its e-mails and chat posts carry only a generic text and the link, also in direct messages. - is_
watching - list
- The newest notifications of a user.
- mark_
read - Marks the given notifications (all if
None) of the actor as read and returns the remaining unread count. - open
- Marks one notification of the actor as read and returns it (for its link).
- restricted_
now_ sql - SQL expression: the notification aliased
nis confidential now – the stored flag, or its subject or something its text names is in a restricted group at delivery time (the group may have been restricted after the row was queued). - send_
test - Sends a test notification to the actor (checks e-mail and Mattermost).
- set_
watch - Starts (
watch = true) or stops watching an item or a change. Returns whether the actor watches it afterwards. - settings
- unread_
count - Unread notifications the actor may still read (a group restricted since, or a lost membership, hides the older ones).
- update_
settings - Saves the actor’s own notification settings (channels, Mattermost name, muted kinds).
- watched
- What the actor watches – only what it may still read (the watches of objects it lost access to stay and come back with the access).