Figuring out digests
Hi!
I'm writing in because the docs are no help on this one. I use Novu for my app and I'm working on comment notifications.
Here's what I'm looking for:
- When someone sends a comment, anyone subscribed to the relevant Novu topic should receive a notification instantly.
- As more replies come in, the user shouldn't be re-notified unless they've already
notification.read()
the pending notification.
- If they haven't read the notification, the notification should be updated as new comments come in (John replied to your post -> John and Jane replied to your post -> John, Jane, and 3 others replied to your post).
- If they have read the notification, the read notification should "disappear" and be replaced by the new updated notification containing more replies.
I've been struggling to figure out how to handle this. I'm pretty sure the digest engine is involved somewhere in this but I'm at a bit of a loss with this.
I can also implement this with custom logic because I'm using Novu headlessly together with the code-based workflow framework, but I thought I'd ask because there might be an easier solution to this.
Thanks!2 Replies
Hi 👋
I am Pawan from Novu
Thanks for sharing the use case. its a bit tricky to build such a workflow.
few notes:
- we don't support changing content of already sent notification
- skipping digest based on partial notification read status is not supported
Since you mentioned that you are using novu/framework, you will have to fetch notifications and check their status before digest step and skip the digest step based on that condition
I am Pawan from Novu
Thanks for sharing the use case. its a bit tricky to build such a workflow.
few notes:
- we don't support changing content of already sent notification
- skipping digest based on partial notification read status is not supported
Since you mentioned that you are using novu/framework, you will have to fetch notifications and check their status before digest step and skip the digest step based on that condition
Hi Pawan! Thanks for your reply. Okay, so I have to treat notifications as immutable. In this case, does it make more sense to implement the batching&grouping logic on the frontend? All our notifications get sent as in-app either way.
I'm also considering doing this with a digest with a lookahead