From 72327716ca34dd28e515ebbc281fc4808d2291f1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Oct 2023 10:40:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E3=83=AA=E3=82=B9=E3=83=88TL?= =?UTF-8?q?=E3=81=AB=E8=87=AA=E5=88=86=E3=81=AE=E3=83=95=E3=82=A9=E3=83=AD?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E9=99=90=E5=AE=9A=E6=8A=95=E7=A8=BF=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 Fix #12110 --- CHANGELOG.md | 4 ++-- packages/backend/src/core/NoteCreateService.ts | 2 +- packages/backend/test/e2e/timelines.ts | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2613e6682c..d6db941cdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ --> -## 2023.x.x (unreleased) +## 2023.11.0 (unreleased) ### General - @@ -23,7 +23,7 @@ https://misskey-hub.net/docs/advanced/publish-on-your-website.html ### Server -- +- Fix: リストTLに自分のフォロワー限定投稿が含まれない問題を修正 ## 2023.10.2 diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 364a300d23..fae512336d 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -868,7 +868,7 @@ export class NoteCreateService implements OnApplicationShutdown { if (note.visibility === 'followers') { // TODO: 重そうだから何とかしたい Set 使う? - userListMemberships = userListMemberships.filter(x => followings.some(f => f.followerId === x.userListUserId)); + userListMemberships = userListMemberships.filter(x => x.userListUserId === user.id || followings.some(f => f.followerId === x.userListUserId)); } // TODO: あまりにも数が多いと redisPipeline.exec に失敗する(理由は不明)ため、3万件程度を目安に分割して実行するようにする diff --git a/packages/backend/test/e2e/timelines.ts b/packages/backend/test/e2e/timelines.ts index 28f07bf3f7..974d2f6820 100644 --- a/packages/backend/test/e2e/timelines.ts +++ b/packages/backend/test/e2e/timelines.ts @@ -947,6 +947,22 @@ describe('Timelines', () => { assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); }); + test.concurrent('リスインしている自分の visibility: followers なノートが含まれる', async () => { + const [alice] = await Promise.all([signup(), signup()]); + + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: alice.id }, alice); + await sleep(1000); + const aliceNote = await post(alice, { text: 'hi', visibility: 'followers' }); + + await waitForPushToTl(); + + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); + + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi'); + }); + test.concurrent('リスインしているユーザーのチャンネルノートが含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]);