Conversation
|
Where exactly do you set sentMailboxId to null? (I can't get the error reproduced) |
I do it in the vue.js devtools browser extension |
ChristophWurst
left a comment
There was a problem hiding this comment.
The changes feel a bit too complex and messy. I think we should try to find a cleaner, less complicated spot to place the logic. I'll think about an alternative.
How about we just move the logic into the head of NewMessageModal::onSend? We have access to the accountId and can fetch the account, check for the mailbox existence and act, then proceed with the usual send logic. The good news is that this isn't too far off the current state. The code just has to be pushed around a bit. I also think we don't necessarily need a special loading text for this state. For the user it's sufficient if we show Sending … while creating/assigning the mailbox |
3913ba7 to
40f8232
Compare
ChristophWurst
left a comment
There was a problem hiding this comment.
The logical flow looks good otherwise
3201810 to
89aaf43
Compare
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
89aaf43 to
3503feb
Compare
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
Toasts were all over the place, |
| /** | ||
| * @param Account $account | ||
| * @param string $name | ||
| * @param array<Horde_Imap_Client::SPECIAL_USE_*> $specialUseAttributes |
There was a problem hiding this comment.
^ see Psalm. Missing an import
| logger.info(`creating ${t('mail', 'Sent')} mailbox`) | ||
| try { | ||
| const newSentMailbox = await this.mainStore.createMailbox({ account, name: (account.personalNamespace ?? '') + t('mail', 'Sent'), specialUseAttributes: ['\\Sent'] }) |
There was a problem hiding this comment.
nit: extract new mailbox name into a variable for code readability and to have the actual mailbox name logged, not just the translation
| try { | ||
| await this.setSentMailboxAndResend(account, sentMailboxId, data) | ||
| showSuccess(t('mail', 'Default sent folder set')) | ||
| this.onSend(data) |
|
|
||
| try { | ||
| await this.setSentMailboxAndResend(account, newSentMailboxId, data) | ||
| this.onSend(data) |
| async onSend(data, force = false) { | ||
| const account = this.mainStore.getAccount(data.accountId) | ||
| if (!account?.sentMailboxId) { | ||
| this.onNewSentMailbox(data, account) |
| const sentMailboxId = mailboxes.find((mailbox) => (mailbox.name === (account.personalNamespace ?? '') + 'Sent') || (mailbox.name === (account.personalNamespace ?? '') + t('mail', 'Sent')))?.databaseId | ||
| if (sentMailboxId) { | ||
| try { | ||
| await this.setSentMailboxAndResend(account, sentMailboxId, data) |
There was a problem hiding this comment.
the method takes to params. data is superfluous
| } | ||
| logger.info(`creating ${t('mail', 'Sent')} mailbox`) | ||
| try { | ||
| const newSentMailbox = await this.mainStore.createMailbox({ account, name: (account.personalNamespace ?? '') + t('mail', 'Sent'), specialUseAttributes: ['\\Sent'] }) |
There was a problem hiding this comment.
createMailbox prepends the namespace too. This can lead to double namespacing.
|
The changes for the backend, to create a mailbox with special usage, are in since #11889. What do you think of implementing everything in the backend, like for the drafts? If there's no sent mailbox, we will just create one in transmission service. I think that makes everything a bit simpler. |










Fix #4153
Repro:
Fix:
Ps: Other ideas are appreciated