From 5dc04633236e6562e3e1508145ab69fb603f0c24 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Oct 2023 16:23:50 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E3=83=AD=E3=83=BC=E3=82=AB?= =?UTF-8?q?=E3=83=AB=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=AB=E6=8A=95=E7=A8=BF=E8=80=85=E8=87=AA=E8=BA=AB=E3=81=AE?= =?UTF-8?q?=E6=8A=95=E7=A8=BF=E3=81=B8=E3=81=AE=E8=BF=94=E4=BF=A1=E3=81=8C?= =?UTF-8?q?=E5=90=AB=E3=81=BE=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../server/api/endpoints/notes/local-timeline.ts | 2 +- packages/backend/test/e2e/timelines.ts | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb49ef573c..f8371379b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ ### Server - Fix: リストTLに自分のフォロワー限定投稿が含まれない問題を修正 +- Fix: ローカルタイムラインに投稿者自身の投稿への返信が含まれない問題を修正 ## 2023.10.2 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 3b6c93fdf9..4b9882e834 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -120,7 +120,7 @@ export default class extends Endpoint { // eslint- if (me && (note.userId === me.id)) { return true; } - if (!ps.withReplies && note.replyId && (me == null || note.replyUserId !== me.id)) return false; + if (!ps.withReplies && note.replyId && note.replyUserId !== note.userId && (me == null || note.replyUserId !== me.id)) return false; if (me && isUserRelated(note, userIdsWhoBlockingMe)) return false; if (me && isUserRelated(note, userIdsWhoMeMuting)) return false; if (note.renoteId) { diff --git a/packages/backend/test/e2e/timelines.ts b/packages/backend/test/e2e/timelines.ts index 974d2f6820..760bb8a574 100644 --- a/packages/backend/test/e2e/timelines.ts +++ b/packages/backend/test/e2e/timelines.ts @@ -526,6 +526,20 @@ describe('Timelines', () => { assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); + test.concurrent('他人のその人自身への返信が含まれる', async () => { + const [alice, bob] = await Promise.all([signup(), signup()]); + + const bobNote1 = await post(bob, { text: 'hi' }); + const bobNote2 = await post(bob, { text: 'hi', replyId: bobNote1.id }); + + await waitForPushToTl(); + + const res = await api('/notes/local-timeline', { limit: 100 }, alice); + + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); + }); + test.concurrent('チャンネル投稿が含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]);