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 324593596a
commit a0db1645f2
2 changed files with 85 additions and 0 deletions

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)
}