From c05de08a3b2ca08931b22d0ddd62b5cce690f881 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 4 Dec 2023 14:13:52 +0000 Subject: [PATCH 1/2] 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 0652c82a9..4b326a4ee 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') From 216d1779974512effe8218949aceb8da21a1a549 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 4 Dec 2023 14:26:37 +0000 Subject: [PATCH 2/2] fix the spacing thanks, linter --- .../backend/src/server/api/endpoints/notes/bubble-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4b326a4ee..c5e3a5a5f 100644 --- a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts @@ -79,7 +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 IN (:...hosts)', { hosts: instance.bubbleInstances}) + .andWhere('note.userHost IN (:...hosts)', { hosts: instance.bubbleInstances }) .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote')