From 1fb2790bb9d09bdda447a62e098b9fe1308562a2 Mon Sep 17 00:00:00 2001 From: Hampus Date: Sun, 6 Sep 2026 19:03:15 +0200 Subject: [PATCH] fix(api): stop bounding the pin listing by the wall clock (#2549) --- .../src/api/channel/services/interaction/MessagePinService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fluxer_api/src/api/channel/services/interaction/MessagePinService.ts b/fluxer_api/src/api/channel/services/interaction/MessagePinService.ts index 111ef61c3..6940a05e9 100644 --- a/fluxer_api/src/api/channel/services/interaction/MessagePinService.ts +++ b/fluxer_api/src/api/channel/services/interaction/MessagePinService.ts @@ -24,6 +24,8 @@ import type {MessagePersistenceService} from '../message/MessagePersistenceServi import {createMessageResponseDataService} from '../message/MessageResponseDataService'; import {MessageInteractionBase} from './MessageInteractionBase'; +const PIN_LIST_UNBOUNDED_TIMESTAMP = new Date('9999-12-31T23:59:59.999Z'); + export class MessagePinService extends MessageInteractionBase { constructor( gatewayService: IGatewayService, @@ -81,7 +83,7 @@ export class MessagePinService extends MessageInteractionBase { const pageSize = Math.min(limit ?? 50, 50); const cutoffTimestamp = hasReadHistory ? null : new Date(authChannel.guild!.message_history_cutoff!).getTime(); const filtered: Array = []; - let before = beforeTimestamp ?? new Date(); + let before = beforeTimestamp ?? PIN_LIST_UNBOUNDED_TIMESTAMP; let exhausted = false; while (filtered.length <= pageSize && !exhausted) { const messages = await this.channelRepository.messageInteractions.listChannelPins(