@social-mail/social-mail-web-server 1.4.920 → 1.4.921

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.4.920",
3
+ "version": "1.4.921",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -42,11 +42,16 @@ export default class SendWebPushNotification extends Workflow<MailboxContactEmai
42
42
  await webPush.push(iterator.deviceToken, email);
43
43
  } catch (error) {
44
44
  if(/expired|unsubscribed/i.test(error)) {
45
- console.error(`Push Subscription for ${iterator.sessionID} expired`);
45
+ console.error(`Push Subscription for ${iterator.sessionID} expired.`);
46
46
  await db.loginSessions.where(iterator, (p) => (x) => x.sessionID === p.sessionID)
47
47
  .update(void 0, (p) => (x) => ({ deviceToken: null, deviceTokenType: null }));
48
48
  continue;
49
49
  }
50
+ if (error.statusCode === 403) {
51
+ console.error(`Push Subscription for ${iterator.sessionID} is no longer valid.`);
52
+ await db.loginSessions.where(iterator, (p) => (x) => x.sessionID === p.sessionID)
53
+ .update(void 0, (p) => (x) => ({ deviceToken: null, deviceTokenType: null }));
54
+ }
50
55
  console.error(error);
51
56
  }
52
57
  }