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,15 +88,19 @@ class PushNotificationPusher
|
|||||||
rescue Webpush::ExpiredSubscription
|
rescue Webpush::ExpiredSubscription
|
||||||
unsubscribe(user, subscription)
|
unsubscribe(user, subscription)
|
||||||
rescue Webpush::ResponseError => e
|
rescue Webpush::ResponseError => e
|
||||||
Discourse.warn_exception(
|
if e.response.message == "MismatchSenderId"
|
||||||
e,
|
unsubscribe(user, subscription)
|
||||||
message: "Failed to send push notification",
|
else
|
||||||
env: {
|
Discourse.warn_exception(
|
||||||
user_id: user.id,
|
e,
|
||||||
endpoint: subscription["endpoint"],
|
message: "Failed to send push notification",
|
||||||
message: message.to_json
|
env: {
|
||||||
}
|
user_id: user.id,
|
||||||
)
|
endpoint: subscription["endpoint"],
|
||||||
|
message: message.to_json
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user