fpm notification framework #695
amitu
started this conversation in
Ideas & RFCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We will have concept of notification-category. It can be added to sitemap and inherited by children. Each NC will have a RSS feed/email-notification etc etc.
notification.mov
In any document a notification object can be defined. FPM scans each document to pick notifications. We only scan for notifications belonging to current package, not to dependencies.
Notification can belong to zero or more channels. Has a subject, body and link. A timestamp when it was published.
UI Behaviour: Read Tracking
Any page can declare what channels are relevant to readers of that page. We can also a global list of channels that is inherited by all pages. If page specifies channels, they are chose to overwrite the list or append to the list.
We do not show how many new notifications are. This is an optimisation. We store
@<channel>-latest-item-timestamp: 123123123123. We also store@<channel>-has-atleast-one-new-item. If this second key is true for any of the channels for current page, the notification dot is shown as red.If the
@<channel>-has-atleast-one-new-itemis not set for any of the channels in the current page list. When and page is loaded, in the background we call the api/-/notifications-timestamps/?channel=<c1>&channel=<c2>which returns the timestamp of latest notification in each channel, and set the local store accordingly.All this gives us only one boolean, if to show the notification dot or not. When user clicks on the notification bell icon we load the sidebar, show a loading indicator and fetch the notifications from
/-/notifications/?channel=<c1>&channel=<c2>. Base on the value of-latest-item-timestampwe show what all notifications are new, and what are old.If the notifications are successfully loaded, and is open for more than 5 seconds all the notifications across all channels are considered read, and -last-item=timestamp` is updated.
RSS
We will also publish a RSS feed at
/-/rss/<channel>/and/-/rss/will show notifications across all channels.Push Notifications
Web based push notifications would be implemented by FPM, so people can subscribe to individual channels. We will show list of channels you have subscribed to also so you can easily unsubscribe.
Email Subscription
If the user is subscribed via email, when FPM detects a new notification in channel listed under email, it will be sent to subscribers.
Email And Push Will Need Database
Till RSS we can implement without a DB, we scan the package when the FPM starts and we have a list of notifications, that we show on RSS feed, or in page notification.
For push and email notifications we will need db. This needs more thinking.
Try Notifications
Some notifications may have a try link as well, people may want to follow the link to read more, but maybe they want to just try out the new thing, which may be another link or a in-page ftd function call.
Beta Was this translation helpful? Give feedback.
All reactions