From 431d8c7802df0df8863211fd797a2eb073be7229 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Oct 2023 16:22:19 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix(backend):=20Redis=E3=81=8C=E3=81=8B?= =?UTF-8?q?=E3=82=89=E3=81=AE=E3=81=A8=E3=81=8D=E3=81=ABhybrid-timeline?= =?UTF-8?q?=E3=81=ABwithReplies=20=3D=20true=E3=81=A7=E3=82=A2=E3=82=AF?= =?UTF-8?q?=E3=82=BB=E3=82=B9=E3=81=99=E3=82=8B=E3=81=A8SQL=E3=81=AE?= =?UTF-8?q?=E3=82=B7=E3=83=B3=E3=82=BF=E3=83=83=E3=82=AF=E3=82=B9=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #12064 --- .../backend/src/server/api/endpoints/notes/hybrid-timeline.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 9986c6e43..f8a7a6a8b 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -123,6 +123,8 @@ export default class extends Endpoint { // eslint- noteIds.sort((a, b) => a > b ? -1 : 1); noteIds = noteIds.slice(0, ps.limit); + shouldFallbackToDb = shouldFallbackToDb || (noteIds.length === 0); + if (!shouldFallbackToDb) { const query = this.notesRepository.createQueryBuilder('note') .where('note.id IN (:...noteIds)', { noteIds: noteIds }) From 93d3501c907945a875453ed974955c22377aa272 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 19 Oct 2023 17:29:09 +0900 Subject: [PATCH 2/3] fix: replies are included even if withReplies = false in local timeline (#12074) --- .../src/server/api/endpoints/notes/local-timeline.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index 9d5688f96..3b6c93fdf 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -163,6 +163,18 @@ export default class extends Endpoint { // eslint- query.andWhere('note.fileIds != \'{}\''); } + if (!ps.withReplies) { + query.andWhere(new Brackets(qb => { + qb + .where('note.replyId IS NULL') // 返信ではない + .orWhere(new Brackets(qb => { + qb // 返信だけど投稿者自身への返信 + .where('note.replyId IS NOT NULL') + .andWhere('note.replyUserId = note.userId'); + })); + })); + } + const timeline = await query.limit(ps.limit).getMany(); process.nextTick(() => { From 721cbe085b39dc8feeb4e57cf75d9c801a5db66d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Oct 2023 17:42:19 +0900 Subject: [PATCH 3/3] fix(frontend): fix of 30efd932a5 --- .../frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts index ea3655f6b..f937b5f9e 100644 --- a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts +++ b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts @@ -60,7 +60,7 @@ export default function(props: { switch (token.type) { case 'text': { let text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n'); - if (!disableNyaize && props.author.isCat) { + if (!disableNyaize && props.author?.isCat) { text = nyaize(text); }