Skip to content

Commit

Permalink
handlematrix: don't ignore errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 13, 2024
1 parent 64144d4 commit a5bf1ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/connector/handlematrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ func (m *MetaClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.Matr

var resp *table.LSTable

retries := 0
for retries < 5 {
for retries := 0; retries < 5; retries++ {
if err = m.Client.WaitUntilCanSendMessages(15 * time.Second); err != nil {
log.Err(err).Msg("Error waiting to be able to send messages, retrying")
} else {
Expand All @@ -108,12 +107,14 @@ func (m *MetaClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.Matr
}
log.Err(err).Msg("Failed to send message to Meta, retrying")
}
retries++
}
if err != nil {
return nil, err
}

log.Trace().Any("response", resp).Msg("Meta send response")
var msgID string
if resp != nil && err == nil {
if resp != nil {
for _, replace := range resp.LSReplaceOptimsiticMessage {
if replace.OfflineThreadingId == otidStr {
msgID = replace.MessageId
Expand Down

0 comments on commit a5bf1ce

Please sign in to comment.