From c761cc30c8b555f0200bcffbea34b63f3669a736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Houl=C3=A9?= <13155277+tomhoule@users.noreply.github.com> Date: Tue, 14 Jul 2026 13:40:24 +0200 Subject: [PATCH] collab: Use new fuzzy search endpoint (#60910) Updates Collab to use the new `/internal/channel_members/fuzzy_search` endpoint that searches users by username (instead of GitHub login). Request and response shapes are the same. Release Notes: - N/A --- crates/cloud_api_types/src/internal_api.rs | 4 ++-- crates/collab/src/services/user_service.rs | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/cloud_api_types/src/internal_api.rs b/crates/cloud_api_types/src/internal_api.rs index 2a352a09da..bfe47f9535 100644 --- a/crates/cloud_api_types/src/internal_api.rs +++ b/crates/cloud_api_types/src/internal_api.rs @@ -44,14 +44,14 @@ pub struct FuzzySearchUsersResponse { } #[derive(Debug, Serialize, Deserialize)] -pub struct FuzzySearchChannelMembersByGithubLoginBody { +pub struct FuzzySearchChannelMembersBody { pub channel_id: i32, pub query: String, pub limit: u32, } #[derive(Debug, Serialize, Deserialize)] -pub struct FuzzySearchChannelMembersByGithubLoginResponse { +pub struct FuzzySearchChannelMembersResponse { pub channel_members: Vec, pub users: Vec, } diff --git a/crates/collab/src/services/user_service.rs b/crates/collab/src/services/user_service.rs index abe22504af..61541aa5a1 100644 --- a/crates/collab/src/services/user_service.rs +++ b/crates/collab/src/services/user_service.rs @@ -1,10 +1,9 @@ use anyhow::{Context as _, anyhow}; use async_trait::async_trait; use cloud_api_types::internal_api::{ - self, FuzzySearchChannelMembersByGithubLoginBody, - FuzzySearchChannelMembersByGithubLoginResponse, FuzzySearchUsersBody, FuzzySearchUsersResponse, - LookUpUserByGithubLoginBody, LookUpUserByGithubLoginResponse, LookUpUsersByLegacyIdBody, - LookUpUsersByLegacyIdResponse, + self, FuzzySearchChannelMembersBody, FuzzySearchChannelMembersResponse, FuzzySearchUsersBody, + FuzzySearchUsersResponse, LookUpUserByGithubLoginBody, LookUpUserByGithubLoginResponse, + LookUpUsersByLegacyIdBody, LookUpUsersByLegacyIdResponse, }; use reqwest::RequestBuilder; use rpc::proto; @@ -157,14 +156,14 @@ impl UserService for CloudUserService { query: &str, limit: u32, ) -> Result<(Vec, Vec)> { - let response_body: FuzzySearchChannelMembersByGithubLoginResponse = self + let response_body: FuzzySearchChannelMembersResponse = self .send_request( self.http_client .post(format!( - "{}/internal/channel_members/fuzzy_search_by_github_login", + "{}/internal/channel_members/fuzzy_search", &self.zed_cloud_url )) - .json(&FuzzySearchChannelMembersByGithubLoginBody { + .json(&FuzzySearchChannelMembersBody { channel_id: channel.root_id().0, query: query.to_string(), limit,