From eaf31a103fd271c80776d2878905131210aef76f Mon Sep 17 00:00:00 2001 From: Miha Rekar Date: Tue, 14 Jan 2025 18:12:16 +0100 Subject: [PATCH] Destroy subscription if it's erroring out --- app/jobs/web_push_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/web_push_job.rb b/app/jobs/web_push_job.rb index b33c3503..13685fdb 100644 --- a/app/jobs/web_push_job.rb +++ b/app/jobs/web_push_job.rb @@ -15,7 +15,7 @@ def perform(push_subscription, title:, body:, path: "/") private_key: Rails.application.credentials.webpush.private_key } ) - rescue WebPush::ExpiredSubscription + rescue WebPush::ExpiredSubscription, WebPush::PushServiceError push_subscription.destroy end end