diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentBackfillJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentBackfillJob.kt index c8a3b9640a..4c88129310 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentBackfillJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentBackfillJob.kt @@ -50,10 +50,10 @@ class ArchiveAttachmentBackfillJob private constructor(parameters: Parameters) : ArchiveUploadProgress.onAttachmentSectionStarted(SignalDatabase.attachments.getPendingArchiveUploadBytes()) if (!isCanceled) { - Log.i(TAG, "Adding ${jobs.size} jobs to backfill attachments.") + Log.i(TAG, "Adding ${jobs.size} jobs to backfill attachments.", true) AppDependencies.jobManager.addAll(jobs) } else { - Log.w(TAG, "Job was canceled. Not enqueuing backfill.") + Log.w(TAG, "Job was canceled. Not enqueuing backfill.", true) } return Result.success() diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentReconciliationJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentReconciliationJob.kt index bb8cea527a..23b8ae19da 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentReconciliationJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentReconciliationJob.kt @@ -95,7 +95,7 @@ class ArchiveAttachmentReconciliationJob private constructor( } if (SignalStore.backup.lastAttachmentReconciliationTime < 0) { - Log.w(TAG, "First ever time we're attempting a reconciliation. Setting the last sync time to now, so we'll run at the proper interval. Skipping this iteration.") + Log.w(TAG, "First ever time we're attempting a reconciliation. Setting the last sync time to now, so we'll run at the proper interval. Skipping this iteration.", true) SignalStore.backup.lastAttachmentReconciliationTime = System.currentTimeMillis() return Result.success() } @@ -127,7 +127,7 @@ class ArchiveAttachmentReconciliationJob private constructor( private fun syncDataFromCdn(snapshotVersion: Long): Result? { do { if (isCanceled) { - Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.") + Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.", true) return Result.failure() } @@ -145,11 +145,11 @@ class ArchiveAttachmentReconciliationJob private constructor( } while (serverCursor != null) if (isCanceled) { - Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.") + Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.", true) return Result.failure() } - Log.d(TAG, "BEFORE:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString()) + Log.d(TAG, "BEFORE:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString(), true) val mediaObjectsThatMayNeedReUpload = SignalDatabase.backupMediaSnapshots.getMediaObjectsLastSeenOnCdnBeforeSnapshotVersion(snapshotVersion) val mayNeedReUploadCount = mediaObjectsThatMayNeedReUpload.count @@ -200,10 +200,10 @@ class ArchiveAttachmentReconciliationJob private constructor( Log.i(TAG, "None of the $mayNeedReUploadCount CDN mismatches were bookkeeping errors.", true) } - Log.d(TAG, "AFTER:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString()) + Log.d(TAG, "AFTER:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString(), true) if (internalUser && mediaIdsThatNeedUpload.isNotEmpty()) { - Log.w(TAG, "Starting internal-only lookup of matching attachments. May take a while!") + Log.w(TAG, "Starting internal-only lookup of matching attachments. May take a while!", true) val matchingAttachments = SignalDatabase.attachments.debugGetAttachmentsForMediaIds(mediaIdsThatNeedUpload, limit = 10_000) Log.w(TAG, "Found ${matchingAttachments.size} out of the ${mediaIdsThatNeedUpload.size} attachments we looked up (capped lookups to 10k).", true) @@ -212,9 +212,9 @@ class ArchiveAttachmentReconciliationJob private constructor( val (attachment, isThumbnail) = pair if (isThumbnail) { val thumbnailTransferState = SignalDatabase.attachments.getArchiveThumbnailTransferState(attachment.attachmentId) - Log.w(TAG, "[Thumbnail] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, archiveThumbnailTransferState=$thumbnailTransferState, hasData=${attachment.hasData}") + Log.w(TAG, "[Thumbnail] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, archiveThumbnailTransferState=$thumbnailTransferState, hasData=${attachment.hasData}", true) } else { - Log.w(TAG, "[Fullsize] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, hasData=${attachment.hasData}") + Log.w(TAG, "[Fullsize] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, hasData=${attachment.hasData}", true) } } } @@ -234,7 +234,7 @@ class ArchiveAttachmentReconciliationJob private constructor( } } } else { - Log.d(TAG, "No attachments need to be repaired.") + Log.d(TAG, "No attachments need to be repaired.", true) } SignalStore.backup.remoteStorageGarbageCollectionPending = false diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveThumbnailBackfillJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveThumbnailBackfillJob.kt index 945dad972b..a276668f3c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveThumbnailBackfillJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveThumbnailBackfillJob.kt @@ -45,10 +45,10 @@ class ArchiveThumbnailBackfillJob private constructor(parameters: Parameters) : .map { attachmentId -> ArchiveThumbnailUploadJob(attachmentId) } if (!isCanceled) { - Log.i(TAG, "Adding ${jobs.size} jobs to backfill thumbnails.") + Log.i(TAG, "Adding ${jobs.size} jobs to backfill thumbnails.", true) AppDependencies.jobManager.addAll(jobs) } else { - Log.w(TAG, "Job was canceled. Not enqueuing backfill.") + Log.w(TAG, "Job was canceled. Not enqueuing backfill.", true) } return Result.success()