sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

User no longer appears in crash reports

Open alokedesai opened this issue 4 years ago • 4 comments
trafficstars

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? Rust 0.23.0

Steps to Reproduce

  1. 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,
        }));
    });
}
  1. Crash the app
panic!("foo")

Expected Result

The crash report should show the user

Actual Result

The crash report does not show the user. Image 2021-10-01 at 3 44 27 PM

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?

alokedesai avatar Oct 01 '21 19:10 alokedesai

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 avatar Oct 04 '21 07:10 Swatinem

@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());
});

FredrikNoren avatar Dec 14 '21 21:12 FredrikNoren

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).

FredrikNoren avatar Dec 28 '21 11:12 FredrikNoren

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.

FredrikNoren avatar Jan 02 '22 10:01 FredrikNoren