From 6c1bcd9a482701e5b03be6221a6a59dff2d92572 Mon Sep 17 00:00:00 2001 From: tai-cha Date: Tue, 27 Jan 2026 17:47:45 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BCT?= =?UTF-8?q?L=E3=81=A7=E3=81=AFFTT=E3=81=AE=E3=82=BD=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=8C=E7=A9=BA=E3=81=AE=E9=9A=9B=E3=81=ABDB=E3=81=ABFallbac?= =?UTF-8?q?k=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 48232ca57b0e8e5a1aa950527ae6ef3a3eb9d0d8. --- .../backend/src/core/FanoutTimelineEndpointService.ts | 8 +++----- packages/backend/src/server/api/endpoints/users/notes.ts | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/FanoutTimelineEndpointService.ts b/packages/backend/src/core/FanoutTimelineEndpointService.ts index d6d409f8f1..b751381599 100644 --- a/packages/backend/src/core/FanoutTimelineEndpointService.ts +++ b/packages/backend/src/core/FanoutTimelineEndpointService.ts @@ -44,7 +44,6 @@ type TimelineOptions = { excludePureRenotes: boolean; ignoreAuthorFromUserSuspension?: boolean; dbFallback: (untilId: string | null, sinceId: string | null, limit: number) => Promise, - preventEmptyTimelineDbFallback?: boolean; }; @Injectable() @@ -80,9 +79,8 @@ export class FanoutTimelineEndpointService { const redisResult = await this.fanoutTimelineService.getMulti(ps.redisTimelines, ps.untilId, ps.sinceId); - // オプション無効時、取得したredisResultのうち、2つ以上ソースがあり、1つでも空であればDBにフォールバックする - let shouldFallbackToDb = ps.useDbFallback && - (ps.preventEmptyTimelineDbFallback !== true && redisResult.length > 1 && redisResult.some(ids => ids.length === 0)); + // 取得したredisResultのうち、2つ以上ソースがあり、1つでも空であればDBにフォールバックする + let shouldFallbackToDb = ps.useDbFallback && (redisResult.length > 1 && redisResult.some(ids => ids.length === 0)); // 取得したresultの中で最古のIDのうち、最も新しいものを取得 // ids自体が空配列の場合、ids[ids.length - 1]はundefinedになるため、filterでnullを除外する @@ -99,7 +97,7 @@ export class FanoutTimelineEndpointService { let noteIds = redisResultIds.slice(0, ps.limit); const oldestNoteId = ascending ? redisResultIds[0] : redisResultIds[redisResultIds.length - 1]; - shouldFallbackToDb ||= ps.useDbFallback && (noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId); + shouldFallbackToDb ||= noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId; if (!shouldFallbackToDb) { let filter = ps.noteFilter ?? (_note => true) as NoteFilter; diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 5034c7986b..b9710250cf 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -151,7 +151,6 @@ export default class extends Endpoint { // eslint- withFiles: ps.withFiles, withRenotes: ps.withRenotes, }, me), - preventEmptyTimelineDbFallback: true, }); return timeline;