backfill: don't delete all backfill messages if will paginate flag set

This commit is contained in:
Nick Mills-Barrett 2025-03-11 14:06:20 +00:00
parent 73dfae2c5c
commit 171e3a7b6b
No known key found for this signature in database
GPG key ID: 31F23F2CF354937B

View file

@ -352,7 +352,7 @@ func (wa *WhatsAppClient) FetchMessages(ctx context.Context, params bridgev2.Fet
// TODO this only deletes after backfilling. If there's no need for backfill after a relogin,
// the messages will be stuck in the database
var err error
if !wa.Main.Bridge.Config.Backfill.Queue.Enabled {
if !wa.Main.Bridge.Config.Backfill.Queue.Enabled && !wa.Main.Bridge.Config.Backfill.WillPaginateManually {
// If the backfill queue isn't enabled, delete all messages after backfilling a batch.
err = wa.Main.DB.Message.DeleteAllInChat(ctx, wa.UserLogin.ID, portalJID)
} else {