Skip to content

RSS Feed for Notifications

Eduardo J edited this page Sep 29, 2021 · 2 revisions

Problem Statement & Solution Document for "RSS Feed for Notifications"

Reality?

RSS Feeds

  • RSS Feeds are for all users.
  • RSS Feeds' items come from notifications.
  • Notifications are built from events.
  • Users can configure where they want to receive their notifications (Web UI, RSS Feeds, email, ...).
  • RSS Feeds include only the last notification for ReviewWanted events, if both Web UI and RSS Feeds are configured.
  • RSS Feeds include all notifications if only RSS Feeds are configured.

Reviews

  • One user sends a BsRequest to another user.
  • Involved users can add multiple Reviews, for that BsRequest.
  • Every time a Review gets created, an ReviewWanted event is created.
  • Every time a ReviewWanted gets created, a Notification is created from it.
  • Then every previous notification for this BsRequest are removed, if Web UI is configured.

Examples of current RSS Feeds can be found in this wiki page.

Consequences?

Users that have Web UI configured will only receive the last ReviewWanted notification in their RSS Feeds.

Future?

No matter what users have configured, users will receive all notifications in their RSS Feeds.

RSS Feeds

  • RSS Feeds are for all users.
  • RSS Feeds' items come from notifications.
  • Notifications are built from events.
  • Users can configure where the want to receive their notifications (Web UI, RSS Feeds, email, ...).
  • RSS Feeds include all notifications for ReviewWanted events.

Reviews

  • One user sends a BsRequest to another user.
  • Involved users can add multiple Reviews, for that BsRequest.
  • Every time a Review gets created, an ReviewWanted event is created.
  • Every time a ReviewWanted gets created, a Notification is created from it.
  • If RSS Feeds is not configured, all the previous notifications of a BsRequest are removed.

Proposal!

Modify the NotificationService::WebChannel service, to not remove outdated notifications, ever:

This also implies to modify the Notifications services, to set the web column to false, in the outdated Notifications of a BsRequest.

Optional: implement again the periodic cleanup.

Implementation:

  • Every time an event happens, we create a new notification. Then, we take the previous notification related to the same notifiable and set their web column to false.
  • To show the right notifications in the Web UI, we need to perform a query to get the only notification with web column set to true per each notifiable.

Dismissed proposals

Modify the NotificationService::WebChannel service, to not remove outdated notifications, ever:

This also implies to modify the Notifications view, to only display the more recent of the Notifications of a BsRequest.

Optional: implement again the periodic cleanup.

Implementation:

  • Every time an event happens, we create a new notification. (no more controls needed)
  • To show the right notifications in the WebUI, we need to perform a query to take all the notifications, group by notifiable, sort every group by created_at, take the most recent one of each group to show it in the WebUI.
  • Modify the NotificationService::WebChannel service, to remove outdated notifications, only in case Web UI is the only Channel configured.

NOTE

  • There are only 96 Token:Rss of about 72.000 users. -> Delete notifications when RSS is not configured implies a important save in memory,
  • We need to check if the user has both Token:Rss and the RSS channel configured to generate all the notifications.
Clone this wiki locally