From 2ee489332589587865a095823a90e1e95be98099 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Fri, 5 May 2023 15:23:24 +0200 Subject: [PATCH] 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. --- internal/user/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/user/sync.go b/internal/user/sync.go index 03515645..d02ca9b4 100644 --- a/internal/user/sync.go +++ b/internal/user/sync.go @@ -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) }