Private
Public Access
1
0

daemon: updatemonitor: dont sync convo list on conversation update, only message sync

This commit is contained in:
2025-05-02 15:46:33 -07:00
parent 2519bc05ad
commit 461c37bd20
2 changed files with 6 additions and 5 deletions

View File

@@ -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?;
} }

View File

@@ -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);
}); });