sentry-rust
sentry-rust copied to clipboard
User no longer appears in crash reports
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which SDK and version? Rust 0.23.0
Steps to Reproduce
- Configure Sentry with a user
pub fn set_user(user: &User) {
// Set user for Rust sentry.
sentry::configure_scope(|scope| {
let mut other = BTreeMap::new();
if user.display_name.is_some() {
other.insert(
"Display Name".to_owned(),
Value::String(user.display_name.as_ref().unwrap().clone()),
);
}
scope.set_user(Some(sentry::User {
email: Some(user.email.clone()),
id: Some(user.local_id.clone()),
ip_address: None,
username: Some(user.screen_name.clone()),
other,
}));
});
}
- Crash the app
panic!("foo")
Expected Result
The crash report should show the user
Actual Result
The crash report does not show the user.

This seems like a recent regression as none of our code has changed here and prior crash reports did report the user correctly. Any idea what could be causing this?
I have looked through the code, and there is no indication that the user is not being correctly passed on. Can you give a minimal code example to reproduce?
@Swatinem I'm having the same issue. I'm setting the user like this:
let user = Some(sentry::User {
id: Some(id.into()),
username: Some(display_name.into()),
..Default::default()
});
sentry::configure_scope(|scope| {
scope.set_user(user.clone());
});
Hm this might be an OSX only issue; I see a user logged in a Windows bug report (but none in my 20+ OSX bugs).
Or maybe not.. I've seen user in OSX reports now as well, but it's really sporadic. Most of the time there's no user information.