Fix push notifications sent without thread subscription (#2118)

* Fix push notifications sent without thread subscription

* Remove duplicate ancestor check
This commit is contained in:
ekzyis 2025-04-21 23:00:21 +02:00 committed by GitHub
parent ff057039f5
commit 4c2f059fb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -256,6 +256,10 @@ export const notifyItemParents = async ({ models, item }) => {
AND NOT EXISTS (
SELECT 1 FROM "Mute" m
WHERE m."muterId" = p."userId" AND m."mutedId" = ${Number(user.id)}
)
AND EXISTS (
-- check that there is at least one parent subscribed to this thread
SELECT 1 FROM "ThreadSubscription" ts WHERE p.id = ts."itemId"
)`
await Promise.allSettled(
parents.map(({ userId, isDirect }) => {