From daed67420c1333b911218b5a1cb59a9da6c96e6d Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 13 Apr 2022 10:15:42 -0600 Subject: [PATCH] historysync: fix backfill logic again * INITIAL_BOOTSTRAP doesn't have 100% as the progress * Enqueue deferred backfills after both RECENT and FULL progress gets to the necessary levels --- historysync.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/historysync.go b/historysync.go index 5c8f959..70d8d51 100644 --- a/historysync.go +++ b/historysync.go @@ -242,16 +242,7 @@ func (user *User) handleHistorySync(reCheckQueue chan bool, evt *waProto.History // most recent portals. If it's the last history sync event, start // backfilling the rest of the history of the portals. if user.bridge.Config.Bridge.HistorySync.Backfill { - if evt.GetProgress() < 99 { - return - } - - doneSyncType := waProto.HistorySync_RECENT - if user.bridge.Config.Bridge.HistorySync.RequestFullSync { - doneSyncType = waProto.HistorySync_FULL - } - - if evt.GetSyncType() != waProto.HistorySync_INITIAL_BOOTSTRAP && evt.GetSyncType() != doneSyncType { + if evt.GetSyncType() != waProto.HistorySync_INITIAL_BOOTSTRAP && evt.GetProgress() < 98 { return }