From e391ad8edd3bd8515f8c19db7697c5a4bda26d8b Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 31 Aug 2020 10:47:39 +1000 Subject: [PATCH] Fix attachment upload retrying --- .../thoughtcrime/securesms/jobs/AttachmentUploadJob.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java b/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java index 766e8f20f6..72a83a47a7 100644 --- a/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java +++ b/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java @@ -27,6 +27,7 @@ import org.whispersystems.signalservice.api.SignalServiceMessageSender; import org.whispersystems.signalservice.api.messages.SignalServiceAttachment; import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer; import org.whispersystems.signalservice.api.push.SignalServiceAddress; +import org.whispersystems.signalservice.loki.api.utilities.HTTP; import java.io.IOException; import java.io.InputStream; @@ -52,7 +53,7 @@ public class AttachmentUploadJob extends BaseJob implements InjectableType { this(new Job.Parameters.Builder() .addConstraint(NetworkConstraint.KEY) .setLifespan(TimeUnit.DAYS.toMillis(1)) - .setMaxAttempts(5) + .setMaxAttempts(10) .build(), attachmentId, destination); } @@ -102,7 +103,8 @@ public class AttachmentUploadJob extends BaseJob implements InjectableType { @Override protected boolean onShouldRetry(@NonNull Exception exception) { - return exception instanceof IOException; + return exception instanceof IOException || + exception instanceof HTTP.HTTPRequestFailedException; } private SignalServiceAttachment getAttachmentFor(Attachment attachment) {