sentry-unity
sentry-unity copied to clipboard
fix: User ID fallback on mobile
User reported events without any user ID coming from the C# layer. This should work out of the box. In case of user.Id
being null the enricher
would set the installation ID.
https://github.com/getsentry/sentry-dotnet/blob/82dcbcdadaf37670729b394bf47489cc73fc7aa1/src/Sentry/Internal/Enricher.cs#L83
But if the ID was an empty string, it would not get overwritten by the enricher, it would not get serialized, and it would not show up on the issue.
To prevent those edge-cases I added fallbacks to both Android and iOS, relying on the same mechanism as we do on desktop to create a new ID and pass it down.