Identify users in amplitude via a separate 'metrics_id' UUID
This commit is contained in:
parent
efdedaab53
commit
5d09083a7d
13 changed files with 316 additions and 239 deletions
|
@ -205,7 +205,8 @@ impl Server {
|
|||
.add_request_handler(Server::follow)
|
||||
.add_message_handler(Server::unfollow)
|
||||
.add_message_handler(Server::update_followers)
|
||||
.add_request_handler(Server::get_channel_messages);
|
||||
.add_request_handler(Server::get_channel_messages)
|
||||
.add_request_handler(Server::get_private_user_info);
|
||||
|
||||
Arc::new(server)
|
||||
}
|
||||
|
@ -1727,6 +1728,20 @@ impl Server {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
async fn get_private_user_info(
|
||||
self: Arc<Self>,
|
||||
request: TypedEnvelope<proto::GetPrivateUserInfo>,
|
||||
response: Response<proto::GetPrivateUserInfo>,
|
||||
) -> Result<()> {
|
||||
let user_id = self
|
||||
.store()
|
||||
.await
|
||||
.user_id_for_connection(request.sender_id)?;
|
||||
let metrics_id = self.app_state.db.get_user_metrics_id(user_id).await?;
|
||||
response.send(proto::GetPrivateUserInfoResponse { metrics_id })?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn store(&self) -> StoreGuard<'_> {
|
||||
#[cfg(test)]
|
||||
tokio::task::yield_now().await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue