daemon: updatemonitor: dont sync convo list on conversation update, only message sync
This commit is contained in:
@@ -240,7 +240,7 @@ impl Daemon {
|
|||||||
|
|
||||||
let guid = outgoing_message.guid.clone();
|
let guid = outgoing_message.guid.clone();
|
||||||
self.post_office_sink.send(PostOfficeEvent::EnqueueOutgoingMessage(outgoing_message)).await.unwrap();
|
self.post_office_sink.send(PostOfficeEvent::EnqueueOutgoingMessage(outgoing_message)).await.unwrap();
|
||||||
|
|
||||||
guid
|
guid
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ impl Daemon {
|
|||||||
// Send conversations updated signal
|
// Send conversations updated signal
|
||||||
signal_sender.send(Signal::ConversationsUpdated).await?;
|
signal_sender.send(Signal::ConversationsUpdated).await?;
|
||||||
|
|
||||||
log::info!(target: target::SYNC, "Synchronized {} conversations", num_conversations);
|
log::info!(target: target::SYNC, "List synchronized: {} conversations", num_conversations);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ impl Daemon {
|
|||||||
// Send conversations updated signal.
|
// Send conversations updated signal.
|
||||||
signal_sender.send(Signal::ConversationsUpdated).await?;
|
signal_sender.send(Signal::ConversationsUpdated).await?;
|
||||||
|
|
||||||
log::info!(target: target::SYNC, "Synchronized {} conversations", num_conversations);
|
log::info!(target: target::SYNC, "Full sync complete, {} conversations processed", num_conversations);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +307,7 @@ impl Daemon {
|
|||||||
let conversation = database.with_repository(|r| r.get_conversation_by_guid(&conversation_id)).await?;
|
let conversation = database.with_repository(|r| r.get_conversation_by_guid(&conversation_id)).await?;
|
||||||
if conversation.is_none() {
|
if conversation.is_none() {
|
||||||
// If the conversation doesn't exist, first do a conversation list sync.
|
// If the conversation doesn't exist, first do a conversation list sync.
|
||||||
|
log::warn!(target: target::SYNC, "Conversation {} not found, performing list sync", conversation_id);
|
||||||
Self::sync_conversation_list(database, signal_sender).await?;
|
Self::sync_conversation_list(database, signal_sender).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ impl UpdateMonitor {
|
|||||||
match update {
|
match update {
|
||||||
UpdateEvent::ConversationChanged(conversation) => {
|
UpdateEvent::ConversationChanged(conversation) => {
|
||||||
log::info!(target: target::UPDATES, "Conversation changed: {:?}", conversation);
|
log::info!(target: target::UPDATES, "Conversation changed: {:?}", conversation);
|
||||||
log::info!(target: target::UPDATES, "Triggering conversation list sync");
|
log::info!(target: target::UPDATES, "Syncing new messages for conversation id: {}", conversation.guid);
|
||||||
self.send_event(Event::SyncConversationList).await
|
self.send_event(|r| Event::SyncConversation(conversation.guid, r)).await
|
||||||
.unwrap_or_else(|e| {
|
.unwrap_or_else(|e| {
|
||||||
log::error!("Failed to send daemon event: {}", e);
|
log::error!("Failed to send daemon event: {}", e);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user