add missing GROUP BY to threadMutingsCache / noteMutingsCache

This commit is contained in:
Hazelnoot 2025-06-10 00:50:53 -04:00
parent 7200c3d6c8
commit d2b4035f7a

View file

@ -159,6 +159,7 @@ export class CacheService implements OnApplicationShutdown {
.createQueryBuilder('muting')
.select('"muting"."userId"', 'userId')
.addSelect('array_agg("muting"."threadId")', 'threadIds')
.groupBy('"muting"."userId"')
.where({ userId: In(muterIds), isPostMute: false })
.getRawMany<{ userId: string, threadIds: string[] }>()
.then(ms => ms.map(m => [m.userId, new Set(m.threadIds)])),
@ -173,6 +174,7 @@ export class CacheService implements OnApplicationShutdown {
.createQueryBuilder('muting')
.select('"muting"."userId"', 'userId')
.addSelect('array_agg("muting"."threadId")', 'threadIds')
.groupBy('"muting"."userId"')
.where({ userId: In(muterIds), isPostMute: true })
.getRawMany<{ userId: string, threadIds: string[] }>()
.then(ms => ms.map(m => [m.userId, new Set(m.threadIds)])),