Skip to content

Commit 991b8ce

Browse files
Merge pull request #2027 from Infomaniak/update-sentry
Update Attachments Sentry padding
2 parents 2682435 + a7b5f19 commit 991b8ce

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

app/src/main/java/com/infomaniak/mail/data/models/Attachment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ class Attachment : EmbeddedRealmObject, Attachable {
8282
* After uploading an Attachment, we replace the local version with the remote one.
8383
* The remote one doesn't know about local data, so we have to backup them.
8484
*/
85-
fun backupLocalData(oldAttachment: Attachment, uploadStatus: UploadStatus, draft: Draft) {
85+
fun backupLocalData(oldAttachment: Attachment, draft: Draft) {
8686
localUuid = oldAttachment.localUuid
8787
uploadLocalUri = oldAttachment.uploadLocalUri
88-
setUploadStatus(uploadStatus, draft, "backupLocalData -> setUploadStatus")
88+
setUploadStatus(UploadStatus.FINISHED, draft, "backupLocalData -> setUploadStatus")
8989
}
9090

9191
fun setUploadStatus(uploadStatus: UploadStatus, draft: Draft? = null, step: String = "") {

app/src/main/java/com/infomaniak/mail/utils/SentryDebug.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object SentryDebug {
115115
fun Int.countPadding(): String = toString().padStart(length = 2, '0')
116116

117117
fun addData(category: String, key: String = "", value: String) {
118-
data[count.countPadding() + "." + category.padStart(length = 15) + key] = value
118+
data[count.countPadding() + "." + (category + key).padStart(length = 19)] = value
119119
count++
120120
}
121121

app/src/main/java/com/infomaniak/mail/utils/extensions/AttachmentExtensions.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import com.infomaniak.mail.R
3434
import com.infomaniak.mail.data.api.ApiRoutes
3535
import com.infomaniak.mail.data.cache.mailboxContent.DraftController
3636
import com.infomaniak.mail.data.models.Attachment
37-
import com.infomaniak.mail.data.models.Attachment.UploadStatus
3837
import com.infomaniak.mail.data.models.mailbox.Mailbox
3938
import com.infomaniak.mail.ui.main.SnackbarManager
4039
import com.infomaniak.mail.ui.main.thread.actions.DownloadAttachmentProgressDialogArgs
@@ -191,7 +190,7 @@ object AttachmentExtensions {
191190
SentryLog.d(ATTACHMENT_TAG, "When removing uploaded attachment, we found (uuids to localUris): $uuidToLocalUri")
192191
SentryLog.d(ATTACHMENT_TAG, "Target uploadLocalUri is: $uploadLocalUri")
193192

194-
remoteAttachment.backupLocalData(oldAttachment = this@updateLocalAttachment, UploadStatus.FINISHED, draft)
193+
remoteAttachment.backupLocalData(oldAttachment = this@updateLocalAttachment, draft)
195194

196195
SentryLog.d(ATTACHMENT_TAG, "Uploaded attachment uuid: ${remoteAttachment.uuid}")
197196
SentryLog.d(ATTACHMENT_TAG, "Uploaded attachment localUuid: ${remoteAttachment.localUuid}")

0 commit comments

Comments
 (0)