Update thread cache on email flag modifications
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 23m53s Details
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 23m44s Details

On a previous commit email flag modification logic was changed, but
threads cache was not updated, leading to threads unread count being
stale.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/315/head
Manos Pitsidianakis 2023-11-27 09:36:13 +02:00
parent 23507932f9
commit 470cae6b88
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
2 changed files with 12 additions and 2 deletions

View File

@ -244,6 +244,7 @@ pub enum JobRequest {
},
SetFlags {
env_hashes: EnvelopeHashBatch,
mailbox_hash: MailboxHash,
flags: SmallVec<[FlagOp; 8]>,
handle: JoinHandle<Result<()>>,
},
@ -329,10 +330,14 @@ impl std::fmt::Debug for JobRequest {
JobRequest::IsOnline { .. } => write!(f, "JobRequest::IsOnline"),
JobRequest::Refresh { .. } => write!(f, "JobRequest::Refresh"),
JobRequest::SetFlags {
env_hashes, flags, ..
env_hashes,
mailbox_hash,
flags,
..
} => f
.debug_struct(stringify!(JobRequest::SetFlags))
.field("env_hashes", &env_hashes)
.field("mailbox_hash", &mailbox_hash)
.field("flags", &flags)
.finish(),
JobRequest::SaveMessage { .. } => write!(f, "JobRequest::SaveMessage"),
@ -1882,6 +1887,7 @@ impl Account {
JobRequest::SetFlags {
ref mut handle,
ref env_hashes,
ref mailbox_hash,
ref flags,
} => match handle.chan.try_recv() {
Ok(Some(Err(err))) => {
@ -1936,8 +1942,11 @@ impl Account {
self.main_loop_handler
.send(ThreadEvent::UIEvent(UIEvent::EnvelopeUpdate(env_hash)));
}
for env_hash in env_hashes.iter() {
self.collection.update_flags(env_hash, *mailbox_hash);
}
}
_ => {}
Err(_) | Ok(None) => {}
},
JobRequest::SaveMessage {
ref mut handle,

View File

@ -44,6 +44,7 @@ impl Account {
job_id,
JobRequest::SetFlags {
env_hashes,
mailbox_hash,
flags,
handle,
},