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)])),