fix(GODT-2614): Handle failed update during sync

The sync process was getting stuck since we never handled the case where
the update to Gluon failed. This caused the flush stage to exist, but
the sync process would continue until it eventually gets stuck due to
lack of progress.
This commit is contained in:
Leander Beernaert
2023-05-05 15:23:24 +02:00
parent 2f7f898cee
commit 2ee4893325

View File

@ -610,6 +610,10 @@ func (user *User) syncMessages(
}, logging.Labels{"sync-stage": "flush"})
for flushUpdate := range flushUpdateCh {
if flushUpdate.err != nil {
return flushUpdate.err
}
if err := vault.SetLastMessageID(flushUpdate.messageID); err != nil {
return fmt.Errorf("failed to set last synced message ID: %w", err)
}