From c05de08a3b2ca08931b22d0ddd62b5cce690f881 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 4 Dec 2023 14:13:52 +0000 Subject: [PATCH] prettier query for bubble timeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I *think* this works; in my test instance (with no federated notes…) the generated query looks correct, and PostgreSQL doesn't complain. --- .../backend/src/server/api/endpoints/notes/bubble-timeline.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts index 0652c82a9d..4b326a4ee4 100644 --- a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts @@ -79,9 +79,7 @@ export default class extends Endpoint { // eslint- ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere('note.visibility = \'public\'') .andWhere('note.channelId IS NULL') - .andWhere( - `(note.userHost = ANY ('{"${instance.bubbleInstances.join('","')}"}'))`, - ) + .andWhere('note.userHost IN (:...hosts)', { hosts: instance.bubbleInstances}) .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote')