getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
566 stars 203 forks source link

User ID is left blank on Android #3302

Open espenrl opened 4 weeks ago

espenrl commented 4 weeks ago

Package

Sentry.Maui

.NET Flavor

.NET

.NET Version

8.0.4

OS

Android

SDK Version

4.4.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

Setup a MAUI project configured for Sentry. Do not override user configuration - hence standard behavior is to be expected with regards to user information in Sentry events.

Expected Result

According to https://docs.sentry.io/platforms/dotnet/guides/maui/enriching-events/identify-user/#id

If you don't provide an id, the SDK falls back to installationId, which the SDK randomly generates once during an app's installation.

Actual Result

User ID is left blank/null in Sentry events.

On iOS the user ID is set to a randomly generated guid and hence works according to documentation.

bitsandfoxes commented 4 weeks ago

Hi @espenrl, thanks for raising this. Looks like a bug - the behaviour should indeed be the same on all platforms.

espenrl commented 4 weeks ago

This logic doesn't seem to be implemented at all for Windows.

And for Android it actually seems to be implemented already, but for some reason doesn't work.

https://github.com/search?q=repo%3Agetsentry%2Fsentry-java+user.setid&type=code

And here is for iOS

https://github.com/search?q=repo%3Agetsentry%2Fsentry-cocoa+%22userid+%3D%22&type=code