From d2b4035f7a40f5efb3d4280f2e46f7ba56f485b4 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Tue, 10 Jun 2025 00:50:53 -0400 Subject: [PATCH] add missing GROUP BY to threadMutingsCache / noteMutingsCache --- packages/backend/src/core/CacheService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/core/CacheService.ts b/packages/backend/src/core/CacheService.ts index 0f05e000d4..7ba1aba1bc 100644 --- a/packages/backend/src/core/CacheService.ts +++ b/packages/backend/src/core/CacheService.ts @@ -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)])),