From 2449b5f4a4dbd717f051fc4608b7570da65c11b4 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 23 Sep 2024 09:23:44 -0400 Subject: [PATCH] Add more debug info around attachment deduping. --- .../org/thoughtcrime/securesms/database/AttachmentTable.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt b/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt index df26874e68..831c9a21e8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt @@ -2331,7 +2331,7 @@ class AttachmentTable( // Our hashMatch already represents a transform-compatible attachment with the most recent upload timestamp. We just need to make sure it has all of the // other necessary fields, and if so, we can use that to skip the upload. - var uploadTemplate: Attachment? = null + var uploadTemplate: DatabaseAttachment? = null if (hashMatch?.hashEnd != null && System.currentTimeMillis() - hashMatch.uploadTimestamp < AttachmentUploadJob.UPLOAD_REUSE_THRESHOLD) { uploadTemplate = readableDatabase .select(*PROJECTION) @@ -2342,7 +2342,7 @@ class AttachmentTable( } if (uploadTemplate != null) { - Log.i(TAG, "[insertAttachmentWithData] Found a valid template we could use to skip upload. (MessageId: $messageId, ${attachment.uri})") + Log.i(TAG, "[insertAttachmentWithData] Found a valid template we could use to skip upload. Template: ${uploadTemplate.attachmentId}, TemplateUploadTimestamp: ${hashMatch?.uploadTimestamp}, CurrentTime: ${System.currentTimeMillis()}, InsertingAttachment: (MessageId: $messageId, ${attachment.uri})") transformProperties = (uploadTemplate.transformProperties ?: transformProperties).copy(skipTransform = true) }