Here prefetch returns messages by INTERNALDATE:
|
let msgs = session |
|
.prefetch(old_uid_next, uids_to_prefetch) |
|
.await |
|
.context("prefetch")?; |
Because of this UIDs in this loop come in arbitrary order:
|
for (uid, ref fetch_response) in msgs { |
But here we update largest_uid_fetched assuming UIDs don't decrease:
|
largest_uid_fetched = max(largest_uid_fetched, uid); |
So if e.g. we prefetch UIDs 1, 3, 2, then fetch 1 and 3 but fail before 2, largest fetched UID would be 3 and we will next time not fetch UID 2.
This INTERNALDATE sorting comes from #3789, it is needed to revert the problem of providers that reorder messages when MOVE is used on a batch of messages.
After removing mvbox_move we don't need to sort prefetch by INTERNALDATE and can sort it by UID.
Here
prefetchreturns messages byINTERNALDATE:core/src/imap.rs
Lines 605 to 608 in 8df9b9e
Because of this UIDs in this loop come in arbitrary order:
core/src/imap.rs
Line 623 in 8df9b9e
But here we update
largest_uid_fetchedassuming UIDs don't decrease:core/src/imap.rs
Line 754 in 8df9b9e
So if e.g. we prefetch UIDs 1, 3, 2, then fetch 1 and 3 but fail before 2, largest fetched UID would be 3 and we will next time not fetch UID 2.
This
INTERNALDATEsorting comes from #3789, it is needed to revert the problem of providers that reorder messages whenMOVEis used on a batch of messages.After removing
mvbox_movewe don't need to sort prefetch byINTERNALDATEand can sort it byUID.