Skip to content

Notifications

Victor Pereira 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 collection describes things that happen throughout the whole OBS (backend+frontend). See the OBS-Events-subsystem page for deeper information about Event.

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

  • OBS Admins can create app wide defaults (EventSubscription.where(user_id: nil))
  • Users can have have Subscriptions that overwrite those defaults

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

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 Events that have email subscribers
    • creates Notifications for all Events that have web/rss subscribers
Clone this wiki locally