guild
guild copied to clipboard
Trigger Mention and QuoteMention notifications upon post update
Currently Mentions/QuoteMentions only create notifications upon post creation.
If a user updates a post to add mentions or fix typos in their mentions, then no new notifications will be created.
The system must track send-notifications per post so that notifications are not re-sent.
Implementation proposal:
- Instead of deleting notifications, give them an
is_deletedboolean field. (must updateUNIQUEnotification indexes withWHERE is_deleted = false) - Whenever a post is updated, extract the mentions from the markup, query for the notifications that already exist for this post, and then create notifications for any new mentions
- If a post has already created
MAX_NOTIFICATION_COUNT_PER_POSTquantity of notifications, then do nothing.