diff options
| author | anatawa12 <anatawa12@icloud.com> | 2024-07-30 19:44:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-30 19:44:08 +0900 |
| commit | 8f40f932e4bac6b4a90a464041a00df315a3c693 (patch) | |
| tree | 18f0a7d21de03d56e0dc730f4953d5dfb6d1ab7f /packages/backend/src/server/api/endpoints/notes | |
| parent | Bump version to 2024.7.0-rc.7 (diff) | |
| download | sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.tar.gz sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.tar.bz2 sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.zip | |
自分のフォロワー限定投稿に対するリプライがホームタイムラインで見えないことが有る問題を修正 (#13835)
* fix: reply to my follower notes are not shown on the home timeline
* fix: reply to follower note by non-following is on social timeline
* docs: changelog
* test: add endpoint test for changes
* test(e2e): 自分のfollowers投稿に対するリプライが流れる
* test(e2e/streaming): 自分のfollowers投稿に対するリプライが流れる
* test(e2e/streaming): フォローしていないユーザによるフォロワー限定投稿に対するリプライがソーシャルタイムラインで表示されることがある問題
* test(e2e/timelines): try fixing typecheck error
---------
Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notes')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts | 13 | ||||
| -rw-r--r-- | packages/backend/src/server/api/endpoints/notes/timeline.ts | 2 |
2 files changed, 14 insertions, 1 deletions
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 f6084b5763..2a2c659942 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -143,6 +143,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- ]; } + const [ + followings, + ] = await Promise.all([ + this.cacheService.userFollowingsCache.fetch(me.id), + ]); + const redisTimeline = await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -153,6 +159,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- useDbFallback: serverSettings.enableFanoutTimelineDbFallback, alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, + noteFilter: note => { + if (note.reply && note.reply.visibility === 'followers') { + if (!Object.hasOwn(followings, note.reply.userId) && note.reply.userId !== me.id) return false; + } + + return true; + }, dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({ untilId, sinceId, diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 8b87908bd3..c9b43b5359 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -114,7 +114,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- excludePureRenotes: !ps.withRenotes, noteFilter: note => { if (note.reply && note.reply.visibility === 'followers') { - if (!Object.hasOwn(followings, note.reply.userId)) return false; + if (!Object.hasOwn(followings, note.reply.userId) && note.reply.userId !== me.id) return false; } return true; |