mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-11-14 14:02:12 +01:00
Allow retries on message taking too long errors
This commit is contained in:
parent
14581a314e
commit
4b69c16f1a
1 changed files with 1 additions and 5 deletions
|
@ -71,12 +71,8 @@ func errorToStatusReason(err error) (reason event.MessageStatusReason, isCertain
|
||||||
return event.MessageStatusUnsupported, true, false, true
|
return event.MessageStatusUnsupported, true, false, true
|
||||||
case errors.Is(err, errTimeoutBeforeHandling):
|
case errors.Is(err, errTimeoutBeforeHandling):
|
||||||
return event.MessageStatusTooOld, true, true, true
|
return event.MessageStatusTooOld, true, true, true
|
||||||
case errors.Is(err, context.DeadlineExceeded):
|
case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errMessageTakingLong):
|
||||||
return event.MessageStatusTooOld, false, true, true
|
return event.MessageStatusTooOld, false, true, true
|
||||||
case errors.Is(err, errMessageTakingLong):
|
|
||||||
// Set can_retry=false here since we'll send another status event allowing the retry later
|
|
||||||
// Technically retrying when this happens is fine, but we'd just ignore it anyway.
|
|
||||||
return event.MessageStatusTooOld, false, false, true
|
|
||||||
case errors.Is(err, errTargetNotFound),
|
case errors.Is(err, errTargetNotFound),
|
||||||
errors.Is(err, errTargetIsFake),
|
errors.Is(err, errTargetIsFake),
|
||||||
errors.Is(err, errReactionDatabaseNotFound),
|
errors.Is(err, errReactionDatabaseNotFound),
|
||||||
|
|
Loading…
Reference in a new issue