Fix: shouldFallbackToDbがすでにtrueの場合にそれが無視される

This commit is contained in:
taichanne30 2024-07-25 14:30:10 +09:00
parent 6cc0138d1e
commit 685fc2bd9d
No known key found for this signature in database
GPG key ID: 1D5EE39F870DC283

View file

@ -75,7 +75,7 @@ export class FanoutTimelineEndpointService {
let noteIds = redisResultIds.filter(id => id >= thresholdId).slice(0, ps.limit); let noteIds = redisResultIds.filter(id => id >= thresholdId).slice(0, ps.limit);
const oldestNoteId = ascending ? redisResultIds[0] : redisResultIds[redisResultIds.length - 1]; const oldestNoteId = ascending ? redisResultIds[0] : redisResultIds[redisResultIds.length - 1];
shouldFallbackToDb = noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId; shouldFallbackToDb ||= noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId;
if (!shouldFallbackToDb) { if (!shouldFallbackToDb) {
let filter = ps.noteFilter ?? (_note => true); let filter = ps.noteFilter ?? (_note => true);