Fix push notification sent without own thread subscription (#2123)

This commit is contained in:
ekzyis 2025-04-23 15:37:20 +02:00 committed by GitHub
parent 1147e1fb81
commit eebc791683
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 }) => {