From f6fb4ab78ce0550d86d145f7207025c80266d83b Mon Sep 17 00:00:00 2001 From: alansley Date: Wed, 22 May 2024 17:04:44 +1000 Subject: [PATCH] Attachment download job re-start preventer removed --- .../conversation/v2/ConversationActivityV2.kt | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 2e421c9a10..b884d3e7ca 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -298,13 +298,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe private val reverseMessageList = false private val adapter by lazy { - - // To prevent repeated attachment download jobs being spawned for any that fail we'll keep - // track of the attachment Ids we've attempted to download. Without this guard mechanism - // then when the retry limit for a failed job is reached another job is immediately spawned - // to download the same attachment (endlessly). - val alreadyAttemptedAttachmentDownloads = mutableSetOf() - val cursor = mmsSmsDb.getConversation(viewModel.threadId, reverseMessageList) val adapter = ConversationAdapter( this, @@ -332,13 +325,8 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } }, onAttachmentNeedsDownload = { attachmentId, mmsId -> - alreadyAttemptedAttachmentDownloads.takeUnless { - attachmentId in it - }?.let { - it += attachmentId - lifecycleScope.launch(Dispatchers.IO) { - JobQueue.shared.add(AttachmentDownloadJob(attachmentId, mmsId)) - } + lifecycleScope.launch(Dispatchers.IO) { + JobQueue.shared.add(AttachmentDownloadJob(attachmentId, mmsId)) } }, glide = glide,