mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 12:58:06 +01:00
Prevent Web::Push notification delivery if notification is outside of TTL window (#32842)
This commit is contained in:
parent
c78dc23b49
commit
aeae152006
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue