Improve error handling resiliance.

This commit is contained in:
Greyson Parrelli
2026-05-04 13:37:25 -04:00
parent e2d4ca9a4c
commit 0542262c49
2 changed files with 3 additions and 2 deletions
@@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.recipients.RecipientId;
import org.thoughtcrime.securesms.recipients.RecipientUtil;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.push.exceptions.PushNetworkException;
import org.whispersystems.signalservice.api.push.exceptions.RateLimitException;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@@ -97,7 +98,7 @@ public final class SendRetryReceiptJob extends BaseJob {
@Override
protected boolean onShouldRetry(@NonNull Exception e) {
return e instanceof PushNetworkException;
return e instanceof PushNetworkException || e instanceof RateLimitException;
}
@Override
@@ -341,7 +341,7 @@ object MessageDecryptor {
if (contentHint == ContentHint.IMPLICIT) {
Log.w(TAG, "${logPrefix(envelope, senderServiceId)} The content hint is $contentHint, so no error message is needed.", true)
Result.Ignore(envelope, serverDeliveredTimestamp, followUpOperations)
return Result.Ignore(envelope, serverDeliveredTimestamp, followUpOperations)
} else {
Log.w(TAG, "${logPrefix(envelope, senderServiceId)} The content hint is $contentHint, so we need to insert an error right away.", true)
return Result.DecryptionError(envelope, serverDeliveredTimestamp, protocolException.toErrorMetadata(), followUpOperations.toUnmodifiableList())