imap: clear mesage totals when fetching entire mailbox
Totals might have been set after a STATUS response, meaning we know the totals without knowing exactly what message UIDs are there. Clear the totals, and start inserting UIDs instead.memfd
parent
6121f77853
commit
0ee3a0bf79
|
@ -207,6 +207,11 @@ impl MailBackend for ImapType {
|
||||||
let mut valid_hash_set: HashSet<EnvelopeHash> = HashSet::default();
|
let mut valid_hash_set: HashSet<EnvelopeHash> = HashSet::default();
|
||||||
let mut our_unseen: BTreeSet<EnvelopeHash> = Default::default();
|
let mut our_unseen: BTreeSet<EnvelopeHash> = Default::default();
|
||||||
Ok(Box::pin(async_stream::try_stream! {
|
Ok(Box::pin(async_stream::try_stream! {
|
||||||
|
{
|
||||||
|
let f = &uid_store.mailboxes.lock().await[&mailbox_hash];
|
||||||
|
f.exists.lock().unwrap().clear();
|
||||||
|
f.unseen.lock().unwrap().clear();
|
||||||
|
};
|
||||||
let (cached_hash_set, cached_payload) = fetch_cached_envs(mailbox_hash, &mut our_unseen, &uid_store)?;
|
let (cached_hash_set, cached_payload) = fetch_cached_envs(mailbox_hash, &mut our_unseen, &uid_store)?;
|
||||||
yield cached_payload;
|
yield cached_payload;
|
||||||
loop {
|
loop {
|
||||||
|
|
Loading…
Reference in New Issue