From fc32abf39f14e2ecec38502fbcaf79c6b60e6a81 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 29 Jul 2024 10:49:33 +0300 Subject: vnext: do not send service notifications to web --- vnext/server/middleware/event.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vnext/server') diff --git a/vnext/server/middleware/event.js b/vnext/server/middleware/event.js index 8280f32b..c80f2249 100644 --- a/vnext/server/middleware/event.js +++ b/vnext/server/middleware/event.js @@ -26,8 +26,9 @@ function processMessageEvent(msg) { subscribers(new URLSearchParams(JSON.parse(JSON.stringify(params)))).then(users => { return users.map(user => { log(`${user.uname}: ${user.unreadCount}`) + let tokenTypes = msg.service ? ['mpns', 'apns', 'fcm'] : ['mpns', 'apns', 'fcm', 'web'] let [sandboxTokens, productionTokens] = (user.tokens || []) - .filter(t => ['mpns', 'apns', 'fcm', 'web'].includes(t.type)) + .filter(t => tokenTypes.includes(t.type)) .map(t => t.type === 'web' ? JSON.parse(t.token) : t.token) .reduce((result, element) => { allSandboxIds.includes(user.uid) -- cgit v1.2.3