fix(GODT-2442): Handle event poll not starting after resync

It is possible, on slower machines, that the new event poll task is not
yet registered and attempts to cancel have nothing to cancel.

In this case, we need the refresh event to cancel the task, at that
point it is guaranteed that the task exists.
This commit is contained in:
Leander Beernaert
2023-03-08 17:02:27 +01:00
parent 13c8a98389
commit 182dab18a6
5 changed files with 22 additions and 12 deletions

View File

@ -326,12 +326,12 @@ func (bridge *Bridge) SendBadEventUserFeedback(_ context.Context, userID string,
logrus.WithError(rerr).Error("Failed to report feedback failure")
}
user.BadEventFeedbackResync(ctx)
if err := bridge.addIMAPUser(ctx, user); err != nil {
return fmt.Errorf("failed to add IMAP user: %w", err)
}
user.BadEventFeedbackResync(ctx)
return nil
}