summaryrefslogtreecommitdiffstats
path: root/ui/src
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-08-02 15:17:23 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-08-02 15:17:23 +0300
commitbc7da4610e3fade403cde07a8da9a86236d02a2d (patch)
tree3c4ed8b5fd3e0c57e7667c1b1dc409029ad9f16d /ui/src
parent3aec1f6decbff3bb016c2425127bde7f46667c85 (diff)
Send MailboxUpdate events when threads are updated
Depending on the insertion order of folders which is non-deterministic because it relies on the kernel's scheduling of parsing threads, the listing the user sees might not be up-to-date because later thread updates are never broadcast. This results in inconsistencies between threads and mail listings when a thread's root envelope was part of a not broadcast update leading to `key not found` panics in a listing's hashmaps.
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/conf/accounts.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/src/conf/accounts.rs b/ui/src/conf/accounts.rs
index 3bf8bd8a..1ebfe606 100644
--- a/ui/src/conf/accounts.rs
+++ b/ui/src/conf/accounts.rs
@@ -468,8 +468,14 @@ impl Account {
return;
}
let (envelopes, mut mailbox) = payload.unwrap();
- self.collection
- .merge(envelopes, folder_hash, &mut mailbox, self.sent_folder);
+ if let Some(updated_folders) =
+ self.collection
+ .merge(envelopes, folder_hash, &mut mailbox, self.sent_folder)
+ {
+ for f in updated_folders {
+ self.notify_fn.notify(f);
+ }
+ }
self.folders
.insert(folder_hash, MailboxEntry::Available(mailbox));
}