mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Delete push subscription on MismatchSenderId error
This should prevent repeated MismatchSenderId warnings when the VAPID keys have changed.
This commit is contained in:
@@ -88,6 +88,9 @@ class PushNotificationPusher
|
||||
rescue Webpush::ExpiredSubscription
|
||||
unsubscribe(user, subscription)
|
||||
rescue Webpush::ResponseError => e
|
||||
if e.response.message == "MismatchSenderId"
|
||||
unsubscribe(user, subscription)
|
||||
else
|
||||
Discourse.warn_exception(
|
||||
e,
|
||||
message: "Failed to send push notification",
|
||||
@@ -100,3 +103,4 @@ class PushNotificationPusher
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user