Fix push notifications sent without thread subscription (#2118)
* Fix push notifications sent without thread subscription * Remove duplicate ancestor check
This commit is contained in:
parent
ff057039f5
commit
4c2f059fb5
@ -256,6 +256,10 @@ export const notifyItemParents = async ({ models, item }) => {
|
|||||||
AND NOT EXISTS (
|
AND NOT EXISTS (
|
||||||
SELECT 1 FROM "Mute" m
|
SELECT 1 FROM "Mute" m
|
||||||
WHERE m."muterId" = p."userId" AND m."mutedId" = ${Number(user.id)}
|
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(
|
await Promise.allSettled(
|
||||||
parents.map(({ userId, isDirect }) => {
|
parents.map(({ userId, isDirect }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user