From ab68967fe875719eee6b94e5bc9b3e2131a10bda Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 29 Sep 2020 19:10:56 -0400 Subject: remove bad subscription --- lib/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/notifications.js') diff --git a/lib/notifications.js b/lib/notifications.js index b1c4b05f..18d5b503 100644 --- a/lib/notifications.js +++ b/lib/notifications.js @@ -16,7 +16,7 @@ notify = (user, payload) => { try { await webpush.sendNotification(subscription, payload); } catch (e) { - if (e.body && e.body.includes('expired')) { + if (e.body && (e.body.includes('expired') || e.body.includes('No such'))) { user.subscriptions.splice(i, 1); await user.save(); } else { -- cgit v1.2.3