1
0

GODT-2202: Report update errors from Gluon

For every update sent to gluon wait and check the error code to see if
an error occurred.

Note: Updates can't be inspect on the call site as it can lead to
deadlocks.
This commit is contained in:
Leander Beernaert
2023-01-13 15:24:09 +01:00
parent 931ed119bb
commit 93c7552a41
7 changed files with 169 additions and 91 deletions

View File

@ -565,18 +565,6 @@ func (user *User) doEventPoll(ctx context.Context) error {
user.log.WithField("event", event).Debug("Handled API event")
// Wait for all events to be applied.
safe.RLock(func() {
for _, updateCh := range xslices.Unique(maps.Values(user.updateCh)) {
update := imap.NewNoop()
defer update.WaitContext(ctx)
updateCh.Enqueue(update)
}
}, user.updateChLock)
user.log.WithField("event", event).Debug("All events applied to gluon")
// Update the event ID in the vault.
if err := user.vault.SetEventID(event.EventID); err != nil {
return fmt.Errorf("failed to update event ID: %w", err)