From 5c997089b6c0be5839629d16d89a208f6fd80289 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 22 Nov 2024 15:18:00 +0100 Subject: [PATCH] backfill: don't try to use non-existent anchor message --- pkg/connector/backfill.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/connector/backfill.go b/pkg/connector/backfill.go index c60bb2f..5e91aae 100644 --- a/pkg/connector/backfill.go +++ b/pkg/connector/backfill.go @@ -18,7 +18,7 @@ func (tc *TwitterClient) FetchMessages(ctx context.Context, params bridgev2.Fetc reqQuery := ptr.Ptr(payload.DmRequestQuery{}.Default()) reqQuery.Count = params.Count - if params.Cursor == "" { + if params.Cursor == "" && params.AnchorMessage != nil { reqQuery.MaxID = string(params.AnchorMessage.ID) } else { reqQuery.MaxID = string(params.Cursor)