panic when deleting email from other client #82

Closed
opened 1 year ago by oblitum · 1 comments
oblitum commented 1 year ago

I was with meli open and, as I have no idea how to delete emails for its UI (I just get "unimplemented"), I deleted one email from my cellphone mail client. This was the sole email being listed in open folder in meli, as soon as I deleted it in my cellphone, meli panicked with:

thread 'meli-executor-6' panicked at 'removal index (is 1) should be < len (is 1)', src/liballoc/vec.rs:1062:13
I was with meli open and, as I have no idea how to delete emails for its UI (I just get "unimplemented"), I deleted one email from my cellphone mail client. This was the sole email being listed in open folder in meli, as soon as I deleted it in my cellphone, meli panicked with: ``` thread 'meli-executor-6' panicked at 'removal index (is 1) should be < len (is 1)', src/liballoc/vec.rs:1062:13 ```
epilys added the
bug
label 1 year ago
Owner

I've located the cause here melib/src/backends/imap/untagged.rs:98

IMAP server sent EXPUNGE 1, and here:

self
                    .uid_store
                    .msn_index
                    .lock()
                    .unwrap()
                    .entry(mailbox_hash)
                    .or_default()
                    .remove(n.try_into().unwrap());

The vector is 0-indexed but message sequence numbers in IMAP start from 1. The fix is to subtract 1 from the index.

I've located the cause here [`melib/src/backends/imap/untagged.rs:98`](https://git.meli.delivery/meli/meli/src/branch/master/melib/src/backends/imap/untagged.rs#L98) IMAP server sent `EXPUNGE 1`, and here: ``` self .uid_store .msn_index .lock() .unwrap() .entry(mailbox_hash) .or_default() .remove(n.try_into().unwrap()); ``` The vector is 0-indexed but message sequence numbers in IMAP start from 1. The fix is to subtract 1 from the index.
epilys closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.