stabilize ids and harden release pipeline
This commit is contained in:
+18
-1
@@ -396,10 +396,27 @@ impl ChatRegistry {
|
||||
}
|
||||
|
||||
if !errors.is_empty() {
|
||||
let mut newly_trashed = 0;
|
||||
trash.update(cx, |trash, cx| {
|
||||
trash.extend(errors);
|
||||
newly_trashed = errors
|
||||
.iter()
|
||||
.filter(|message| trash.insert((*message).clone()))
|
||||
.count();
|
||||
cx.notify();
|
||||
})?;
|
||||
|
||||
// Only newly trashed messages emit an error event so repeated
|
||||
// reprocess attempts of the same message don't re-alert the user
|
||||
if newly_trashed > 0 {
|
||||
let reason = if newly_trashed == 1 {
|
||||
"A message could not be decrypted".to_string()
|
||||
} else {
|
||||
format!("{newly_trashed} messages could not be decrypted")
|
||||
};
|
||||
this.update(cx, |_, cx| {
|
||||
cx.emit(ChatEvent::Error(reason));
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
if eose && tracking.swap(false, Ordering::AcqRel) {
|
||||
|
||||
Reference in New Issue
Block a user