You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this awesome gem and I have a notifiable model with dependent_notifications: :destroy enabled. The issue is that if the notifiable is created and shortly destroyed before the mailer job is performed, I get a Couldn't find ActivityNotification::Notification with 'id'=xyz error in the background jobs cause the corresponding notification is destroyed. I know this is an edge case, but there is a real case for it, in my case, the notifiable is a "Like" action and if user clicks on Like and UnLike quickly this happens.
I also couldn't keep the notifications around after the notifiable is destroyed cause the email template then can't find the Notifiable to generate an email.
The text was updated successfully, but these errors were encountered:
Also googling around a bit for canceling Active Jobs (DelayedJobs in my case) in a callback monkey-patched to ActivityNotification::Notification, it turns out there is no supported API to do that. A better/simpler way would be to let the mailer job execute but do nothing if the notification is destroyed. Not sure that's doable in ActionMailer::DeliveryJob.
This makes sense. Is it OK to add the option which Mailer will ignore them or just create logs without sending email when Notification record cannot be found?
I'm using this awesome gem and I have a notifiable model with
dependent_notifications: :destroy
enabled. The issue is that if the notifiable is created and shortly destroyed before the mailer job is performed, I get aCouldn't find ActivityNotification::Notification with 'id'=xyz
error in the background jobs cause the corresponding notification is destroyed. I know this is an edge case, but there is a real case for it, in my case, the notifiable is a "Like" action and if user clicks on Like and UnLike quickly this happens.I also couldn't keep the notifications around after the notifiable is destroyed cause the email template then can't find the Notifiable to generate an email.
The text was updated successfully, but these errors were encountered: