@@ -340,7 +340,7 @@ class NewMessageViewModel @Inject constructor(
340
340
341
341
if (mailToUri != null ) handleMailTo(draft, mailToUri)
342
342
343
- SentryDebug .addAttachmentsBreadcrumb(draft)
343
+ SentryDebug .addAttachmentsBreadcrumb(draft, step = " populate Draft with external mail data " )
344
344
}
345
345
346
346
private fun Draft.flagRecipientsAsAutomaticallyEntered () {
@@ -749,7 +749,12 @@ class NewMessageViewModel @Inject constructor(
749
749
fun uploadAttachmentsToServer (uiAttachments : List <Attachment >) = viewModelScope.launch(ioDispatcher) {
750
750
val localUuid = draftLocalUuid ? : return @launch
751
751
val localDraft = mailboxContentRealm().writeBlocking {
752
- DraftController .getDraft(localUuid, realm = this )?.also { it.updateDraftAttachmentsWithLiveData(uiAttachments) }
752
+ DraftController .getDraft(localUuid, realm = this )?.also {
753
+ it.updateDraftAttachmentsWithLiveData(
754
+ uiAttachments = uiAttachments,
755
+ step = " observeAttachments -> uploadAttachmentsToServer" ,
756
+ )
757
+ }
753
758
} ? : return @launch
754
759
755
760
runCatching {
@@ -815,7 +820,10 @@ class NewMessageViewModel @Inject constructor(
815
820
cc = ccLiveData.valueOrEmpty().toRealmList()
816
821
bcc = bccLiveData.valueOrEmpty().toRealmList()
817
822
818
- updateDraftAttachmentsWithLiveData(attachmentsLiveData.valueOrEmpty())
823
+ updateDraftAttachmentsWithLiveData(
824
+ uiAttachments = attachmentsLiveData.valueOrEmpty(),
825
+ step = " executeDraftActionWhenStopping (action = ${draftAction.name} ) -> updateDraftFromLiveData" ,
826
+ )
819
827
820
828
subject = subjectValue
821
829
@@ -850,7 +858,7 @@ class NewMessageViewModel @Inject constructor(
850
858
}
851
859
}
852
860
853
- private fun Draft.updateDraftAttachmentsWithLiveData (uiAttachments : List <Attachment >) {
861
+ private fun Draft.updateDraftAttachmentsWithLiveData (uiAttachments : List <Attachment >, step : String ) {
854
862
855
863
/* *
856
864
* If :
@@ -885,7 +893,7 @@ class NewMessageViewModel @Inject constructor(
885
893
addAll(updatedAttachments)
886
894
}
887
895
888
- SentryDebug .addAttachmentsBreadcrumb(draft = this )
896
+ SentryDebug .addAttachmentsBreadcrumb(draft = this , step )
889
897
}
890
898
891
899
private fun Draft.getWholeBody (): String = uiBody.textToHtml() + (uiSignature ? : " " ) + (uiQuote ? : " " )
0 commit comments