about summary refs log tree commit diff
path: root/app/workers/web/push_notification_worker.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-12-18 16:55:15 +0100
committerThibaut Girka <thib@sitedethib.com>2018-12-18 16:55:15 +0100
commit034ffc079e40e0c723173b5998242803cc28dc50 (patch)
treefee1b208be2068cf372ab23f268a66ca51cc2dc3 /app/workers/web/push_notification_worker.rb
parent36d27e289177fdec5332539c94b8192022a412f2 (diff)
parent5bf100f87be571e86305f3ab244183fc46f1ede2 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/controllers/admin/base_controller.rb
  Some refactoring made upstream, no real conflict.
- app/javascript/mastodon/features/compose/components/compose_form.js
  Updated using upstream's code but using maxChars instead of the
  hardcoded length of 500 characters per toot.
- app/javascript/styles/mastodon/components.scss
  Upstream redesigned the onboarding modal. Not sure why we had a
  conflict there.
Diffstat (limited to 'app/workers/web/push_notification_worker.rb')
-rw-r--r--app/workers/web/push_notification_worker.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/web/push_notification_worker.rb b/app/workers/web/push_notification_worker.rb
index 4a40e5c8b..8e8a35973 100644
--- a/app/workers/web/push_notification_worker.rb
+++ b/app/workers/web/push_notification_worker.rb
@@ -10,8 +10,8 @@ class Web::PushNotificationWorker
     notification = Notification.find(notification_id)
 
     subscription.push(notification) unless notification.activity.nil?
-  rescue Webpush::InvalidSubscription, Webpush::ExpiredSubscription
-    subscription.destroy!
+  rescue Webpush::ResponseError => e
+    subscription.destroy! if (400..499).cover?(e.response.code.to_i)
   rescue ActiveRecord::RecordNotFound
     true
   end