Skip to content

Notifications

Henne Vogelsang edited this page Apr 22, 2020 · 28 revisions

Details about our notification sub-system.

This sub-system is based on the Event, Subscription and Notification classes.

An Event describes things that happen throughout the whole OBS (backend+frontend). See the Events page for deeper information about Event.

A Subscription is specific for a User, a type of Event (eventtype=Event::CommentForPackage), a Role the User might have (receiver_role="maintainer") and the place where it should be displayed (channel=web)

  • OBS admins can create app wide defaults (EventSubscription.where(user_id: nil))
  • A User can have a collection of Subscription that overwrites those defaults

A Notification is for a specific Event, a User (subscriber_id=1) and one or more places where it should be displayed (rss=true, web=false)

Workflow

  • An Event gets stored in the database
  • clockwork periodically schedules a SendEventEmailsJob
  • SendEventEmailsJob goes over the Event table and
    • sends e-mail for all Event that have email subscribers
    • creates Notification for all Event that have web/rss subscribers
Clone this wiki locally