getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
812 stars 324 forks source link

Clarification User id vs. app.device #3118

Closed bb-git closed 1 year ago

bb-git commented 1 year ago

Platform

iOS

Installed

CocoaPods

Version

7.7.3

Steps to Reproduce

always happening

Expected Result

The app.device stays the same, but the User id is changing. The SDK reports 5 users experiencing a crash, because of different user ids, but the app.device has only 2 different values. Looking at all the other data (iOS version, device, etc.) it looks like there are really only 2 users affected. How is it possible these values differ? Shouldn't both values be deleted with the app and remain the same as long as the app is installed?

Actual Result

more user ids than app.device values

Are you willing to submit a PR?

No response

brustolin commented 1 year ago

Hello @bb-git, thanks for reaching out.

I'm a little confused with your expectation which describes "The app.device stays the same, but the User id is changing" and this is also the actual result "more user ids than app.device values"

This is exactly as designed, if the user deletes the app, the app.device remains the same because we calculated it according to device informations but the user id is random generated again for the new installation.

bb-git commented 1 year ago

Ah great, thanks for clarifying. This is a very valuable metric. In #1541 it was stated differently.

Does it change when updating iOS?

brustolin commented 1 year ago

Does it change when updating iOS?

No, the iOS version is not taken in account for this informations.

brustolin commented 1 year ago

If you need more help let me know.

lhunath commented 1 year ago

@brustolin would you be able to indicate whether there is API in sentry-cocoa to obtain the device identifier which Sentry is using? I'd like to use it to create a dev link to the current device's list of sentry issues. I expected it to be UIDevice.current.identifierForVendor, but this appears to not be the case. IMO all information obtained from my customer's device should be accessible to me.