BlueBubbles wasn't honoring the chatId filter used on the query messages endpoint so it was returning messages from all chats during the backfill process. I swapped the endpoint for the /chat/[chat id]/messages endpoint and updated the query with the proper params to account for the change. Notably, BlueBubbles has a maximum limit of 1000 messages, so the query function has also been updated accordingly.
Before anyone wonders, no, this still does not backfill tapbacks. That code doesn't appear to exist in the original bridge:
if msg.Tapback != nil {
// TODO handle tapbacks
portal.log.Debugln("Skipping tapback", msg.GUID, "in backfill")
continue
}
BlueBubbles wasn't honoring the chatId filter used on the query messages endpoint so it was returning messages from all chats during the backfill process. I swapped the endpoint for the /chat/[chat id]/messages endpoint and updated the query with the proper params to account for the change. Notably, BlueBubbles has a maximum limit of 1000 messages, so the query function has also been updated accordingly.
Before anyone wonders, no, this still does not backfill tapbacks. That code doesn't appear to exist in the original bridge: