From eebc791683e3a4cfe149875e76d62dda18043cb3 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Wed, 23 Apr 2025 15:37:20 +0200 Subject: [PATCH] Fix push notification sent without own thread subscription (#2123) --- lib/webPush.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webPush.js b/lib/webPush.js index d28ab8bb..c697afd5 100644 --- a/lib/webPush.js +++ b/lib/webPush.js @@ -259,7 +259,7 @@ export const notifyItemParents = async ({ models, item }) => { ) AND EXISTS ( -- check that there is at least one parent subscribed to this thread - SELECT 1 FROM "ThreadSubscription" ts WHERE p.id = ts."itemId" + SELECT 1 FROM "ThreadSubscription" ts WHERE p.id = ts."itemId" AND p."userId" = ts."userId" )` await Promise.allSettled( parents.map(({ userId, isDirect }) => {