-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix no sent mailbox configured #8311
base: main
Are you sure you want to change the base?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Signed-off-by: hamza221 <[email protected]>
Signed-off-by: hamza221 <[email protected]>
Signed-off-by: hamza221 <[email protected]>
41a492a
to
3913ba7
Compare
Signed-off-by: hamza221 <[email protected]> Signed-off-by: Hamza Mahjoubi <[email protected]>
3913ba7
to
40f8232
Compare
Signed-off-by: Hamza Mahjoubi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logical flow looks good otherwise
showWarning(t('mail', 'Setting Sent default folder')) | ||
let newSentMailboxId = null | ||
const mailboxes = this.mainStore.getMailboxes(data.accountId) | ||
const sentMailboxId = mailboxes.find((mailbox) => mailbox.name === account.personalNamespace + 'Sent' || mailbox.name === account.personalNamespace + t('mail', 'Sent'))?.databaseId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. first look for the localized, then search for Sent
. this ensures that the localized takes priority.
const mailboxes = this.mainStore.getMailboxes(data.accountId) | ||
const sentMailboxId = mailboxes.find((mailbox) => mailbox.name === account.personalNamespace + 'Sent' || mailbox.name === account.personalNamespace + t('mail', 'Sent'))?.databaseId | ||
if (sentMailboxId) { | ||
await this.setSentMailboxAndResend(account, sentMailboxId, data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing a return or anything else that leaves this method after setting the existing mailbox
} | ||
logger.info(`creating ${t('mail', 'Sent')} mailbox`) | ||
try { | ||
const newSentMailbox = await this.mainStore.createMailbox({ account, name: account.personalNamespace + t('mail', 'Sent') }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the IMAP server supports it (likely) we should also set the specialuse attribute to \sent
Fix #4153
Repro:
Fix:
Ps: Other ideas are appreciated