mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
fix: emit DC_EVENT_MSGS_CHANGED without IDs when the message expires
Specifying msg IDs that cannot be loaded in the event payload results in an error when the UI tries to load the message. Instead, emit an event without IDs to make the UI reload the whole messagelist.
This commit is contained in:
@@ -429,7 +429,7 @@ pub(crate) async fn delete_expired_messages(context: &Context, now: i64) -> Resu
|
||||
if !rows.is_empty() {
|
||||
info!(context, "Attempting to delete {} messages.", rows.len());
|
||||
|
||||
let (msgs_changed, webxdc_deleted) = context
|
||||
let (_msgs_changed, webxdc_deleted) = context
|
||||
.sql
|
||||
.transaction(|transaction| {
|
||||
let mut msgs_changed = Vec::with_capacity(rows.len());
|
||||
@@ -455,9 +455,7 @@ pub(crate) async fn delete_expired_messages(context: &Context, now: i64) -> Resu
|
||||
})
|
||||
.await?;
|
||||
|
||||
for (chat_id, msg_id) in msgs_changed {
|
||||
context.emit_msgs_changed(chat_id, msg_id);
|
||||
}
|
||||
context.emit_msgs_changed_without_ids();
|
||||
|
||||
for msg_id in webxdc_deleted {
|
||||
context.emit_event(EventType::WebxdcInstanceDeleted { msg_id });
|
||||
|
||||
Reference in New Issue
Block a user