Skip to content

Commit

Permalink
Merge pull request #1780 from Infomaniak/add-more-debug-infos
Browse files Browse the repository at this point in the history
Add sentry log to understand issue #3276
  • Loading branch information
FabianDevel committed Mar 20, 2024
2 parents ade9c35 + 30886cf commit 0c05b9d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,13 @@ class DraftsActionsWorker @AssistedInject constructor(
private fun Attachment.updateLocalAttachment(draftLocalUuid: String, remoteAttachment: Attachment) {
mailboxContentRealm.writeBlocking {
draftController.updateDraft(draftLocalUuid, realm = this) { draft ->
val uuidToLocalUri = draft.attachments.map { it.uuid to it.uploadLocalUri }
SentryLog.d(
ATTACHMENT_TAG,
"When removing just uploaded attachment we found (Uuids to localUris): $uuidToLocalUri"
)
SentryLog.d(ATTACHMENT_TAG, "Target uploadLocalUri is: $uploadLocalUri")

delete(draft.attachments.first { localAttachment -> localAttachment.uploadLocalUri == uploadLocalUri })
draft.attachments.add(remoteAttachment)
}
Expand Down

0 comments on commit 0c05b9d

Please sign in to comment.