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
|
@ -320,11 +320,9 @@ impl Client {
|
|||
log::info!("set status on client {}: {:?}", self.id, status);
|
||||
let mut state = self.state.write();
|
||||
*state.status.0.borrow_mut() = status;
|
||||
let user_id = state.credentials.as_ref().map(|c| c.user_id);
|
||||
|
||||
match status {
|
||||
Status::Connected { .. } => {
|
||||
self.telemetry.set_user_id(user_id);
|
||||
state._reconnect_task = None;
|
||||
}
|
||||
Status::ConnectionLost => {
|
||||
|
@ -353,7 +351,7 @@ impl Client {
|
|||
}));
|
||||
}
|
||||
Status::SignedOut | Status::UpgradeRequired => {
|
||||
self.telemetry.set_user_id(user_id);
|
||||
self.telemetry.set_metrics_id(None);
|
||||
state._reconnect_task.take();
|
||||
}
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue