diff --git a/app/workers/web/push_notification_worker.rb b/app/workers/web/push_notification_worker.rb index 824e7b5940..3629904fa7 100644 --- a/app/workers/web/push_notification_worker.rb +++ b/app/workers/web/push_notification_worker.rb @@ -13,6 +13,8 @@ class Web::PushNotificationWorker @subscription = Web::PushSubscription.find(subscription_id) @notification = Notification.find(notification_id) + return if @notification.updated_at < TTL.ago + # Polymorphically associated activity could have been deleted # in the meantime, so we have to double-check before proceeding return unless @notification.activity.present? && @subscription.pushable?(@notification)