~reykjalin/jarm#23: 
Fix notifications

Notifications don't always get delivered. Current implementation is all done in Elixir to find which posts should be included in notifications, but that's probably causing the bugs. Code should probably look something like the following after the fix:

## THIS IS ALL PSEUDO-CODE ##

# We get these here because any posts created while notifications are being delivered should receive the notification_sent flag.
posts_with_no_notification_sent = Timeline.get_posts_with_no_notification_sent()
comments_with_no_notification_sent = Timeline.get_comments_with_no_notification_sent()

foreach ( user ) do
    new_posts = get_new_posts_for( user ) # From DB
    new_comments = get_new_comments_for( user ) # From DB
    new_comments_on_posts = get_new_comments_on_posts_made_by( user ) # From DB

    send_notification( user, new_posts, new_comments, new_comments_on_posts )
end

set_notified( posts_with_no_notification_sent )
set_notified( comments_with_no_notification_sent )
Status
REPORTED
Submitter
~reykjalin
Assigned to
No-one
Submitted
9 months ago
Updated
9 months ago
Labels
No labels applied.

~reykjalin 9 months ago

Look at the commits that removed the full DB approach in favor of a more in-code approach to notifications to see how to get the right posts out of the DB via DB queries: d5a42e3e343be86b7b5ba68f76e189ad697cbbc0

Register here or Log in to comment, or comment via email.