diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index b8e16a8650..86fe8c8512 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -831,16 +831,28 @@ impl Server { request: TypedEnvelope, response: Response, ) -> Result<()> { - let (connection_ids, metadata_changed) = self.store_mut().await.update_worktree( - request.sender_id, - request.payload.project_id, - request.payload.worktree_id, - &request.payload.root_name, - &request.payload.removed_entries, - &request.payload.updated_entries, - request.payload.scan_id, - )?; - // TODO: log `extension_counts` from `Worktree`. + let (connection_ids, metadata_changed) = { + let mut store = self.store_mut().await; + let (connection_ids, metadata_changed, extension_counts) = store.update_worktree( + request.sender_id, + request.payload.project_id, + request.payload.worktree_id, + &request.payload.root_name, + &request.payload.removed_entries, + &request.payload.updated_entries, + request.payload.scan_id, + )?; + for (extension, count) in extension_counts { + tracing::info!( + project_id = request.payload.project_id, + worktree_id = request.payload.worktree_id, + ?extension, + %count, + "worktree updated" + ); + } + (connection_ids, metadata_changed) + }; broadcast(request.sender_id, connection_ids, |connection_id| { self.peer diff --git a/crates/collab/src/rpc/store.rs b/crates/collab/src/rpc/store.rs index 1d88264d72..e206bcee74 100644 --- a/crates/collab/src/rpc/store.rs +++ b/crates/collab/src/rpc/store.rs @@ -577,8 +577,9 @@ impl Store { removed_entries: &[u64], updated_entries: &[proto::Entry], scan_id: u64, - ) -> Result<(Vec, bool)> { + ) -> Result<(Vec, bool, &HashMap)> { let project = self.write_project(project_id, connection_id)?; + let connection_ids = project.connection_ids(); let mut worktree = project.worktrees.entry(worktree_id).or_default(); let metadata_changed = worktree_root_name != worktree.root_name; worktree.root_name = worktree_root_name.to_string(); @@ -602,8 +603,7 @@ impl Store { worktree.entries.insert(entry.id, entry.clone()); } worktree.scan_id = scan_id; - let connection_ids = project.connection_ids(); - Ok((connection_ids, metadata_changed)) + Ok((connection_ids, metadata_changed, &worktree.extension_counts)) } pub fn project_connection_ids(