GODT-2223: Handle bad events by logging user out

This commit is contained in:
James Houlahan
2023-01-17 15:11:13 +01:00
committed by Leander Beernaert
parent 70f0384cc3
commit 849c8bee78
4 changed files with 80 additions and 23 deletions

View File

@ -670,9 +670,8 @@ func getMailboxName(label proton.Label) []string {
func waitOnIMAPUpdates(ctx context.Context, updates []imap.Update) error {
for _, update := range updates {
err, ok := update.WaitContext(ctx)
if ok && err != nil {
return fmt.Errorf("failed to apply gluon update %v :%w", update.String(), err)
if err, ok := update.WaitContext(ctx); ok && err != nil {
return fmt.Errorf("failed to apply gluon update %v: %w", update.String(), err)
}
}