...
In early discussion about notifications for Discussion Forum, we recognize that this kind of notifications is different from the Synapse Email Services that we have. In this case, users may want to subscribe to a topic or an object in Synapse and received notifications when something changed within this topic/ object. When receiving notifications about the events, user may or may not want to take any action. Users should also be able to choose the type of notifications they would like to receive, and be able to unsubscribe to a topic/ object and still receive notifications about events that happen around another topic/ object.
Approach
When an event happens on a subscribable object, a message will be pushed to the object topic. From there, the message will be forwarded to each subscriber topic. Each subscriber has a queue of events that the subscriber is listening to. A worker will periodically check this queue and combine events. The worker may send the combined event message to the Synapse Email Services to send an email to the user, or push the combined message back to the queue. From the Web UI, the UI can make request to see all events.
...
We will pick one approach and move forward. Depending on what other problems that come up during the implementation, we may switch to a different approach.
Problems that need solution
Inactive object/ topic
How do we know if an AWS topic is inactive?
If there is no ways for us to check the AWS topic's inactivity, how do we keep track of the object's inactivity?
Staging vs Prod
When a new thread created in staging, do we send notification for all users that subscribe to the forum?
If so, should we point them to staging or prod? If we point them to staging, they will see the new thread, but may be confused between staging and prod. If we point them to prod, they will not be able to see the new thread and may think that Synapse is broken.
Models
API
Action | Intended User | URI | Method | Request Params | Request Body | Response Body | |
---|---|---|---|---|---|---|---|
1 | subscribe to an object | Synapse users who has READ permission on the object | /subscriptions | POST | Subscription | Subscription | |
2 | retrieve subscriptions for a list of objects | Synapse users | /subscriptions | PUT | List<Topic> | SubscriptionPage | |
3 | unsubscribe to an object | Synapse users who subscribed to the object | /subscriptions/unsubscribe/{objectId}/type/{objectType} | DELETE | |||
...