You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
However that's only the .NET side of the sync, which ensures that any changes made in the .NET SDK will be reflected in the Java SDK. Potentially the opposite (Java syncing with .NET) is not setup. Probably need to check if the JavaSDK has any observer/notifier capability around this that we could leverage.
If not, another possibility would be to imitate this functionality inside the .NET SDK... that'd be a little bit fiddly - we'd need to someone refactor this so that it could be leveraged via a null coalescing operator in the getter for the user id.
However that's only the .NET side of the sync, which ensures that any changes made in the .NET SDK will be reflected in the Java SDK. Potentially the opposite (Java syncing with .NET) is not setup. Probably need to check if the JavaSDK has any observer/notifier capability around this that we could leverage.
@adinauer does this look familiar to you (syncing scope data between the SDKs)? Do you know if there is any functionality in the Java SDK to sync scope data when it changes in the Java SDK?
In this particular case, the Java SDK sets the User.Id, but it's not being reflected up in the .NET layer before events get sent to Sentry.
Activity
bitsandfoxes commentedon Apr 15, 2024
Hi @espenrl, thanks for raising this. Looks like a bug - the behaviour should indeed be the same on all platforms.
espenrl commentedon Apr 16, 2024
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
jamescrosswell commentedon Jun 17, 2024
This should be picked up here:
sentry-dotnet/src/Sentry/Scope.cs
Lines 122 to 138 in d664fc6
And here:
sentry-dotnet/src/Sentry/SentryUser.cs
Lines 24 to 35 in 5fab09e
However that's only the .NET side of the sync, which ensures that any changes made in the .NET SDK will be reflected in the Java SDK. Potentially the opposite (Java syncing with .NET) is not setup. Probably need to check if the JavaSDK has any observer/notifier capability around this that we could leverage.
If not, another possibility would be to imitate this functionality inside the .NET SDK... that'd be a little bit fiddly - we'd need to someone refactor this so that it could be leveraged via a null coalescing operator in the getter for the user id.
jamescrosswell commentedon Jun 17, 2024
@adinauer does this look familiar to you (syncing scope data between the SDKs)? Do you know if there is any functionality in the Java SDK to sync scope data when it changes in the Java SDK?
In this particular case, the Java SDK sets the User.Id, but it's not being reflected up in the .NET layer before events get sent to Sentry.
adinauer commentedon Jun 18, 2024
Hey @jamescrosswell we do have
IScopeObserver, which can be registered in options viaaddScopeObserver. Maybe this NDK implementation helps: https://github.com/getsentry/sentry-java/blob/051ce9bce330e4a690fd59db52e506219a35eae9/sentry-android-ndk/src/main/java/io/sentry/android/ndk/NdkScopeObserver.javajamescrosswell commentedon Jun 18, 2024
Awesome, thanks @adinauer !
@bitsandfoxes I'm not sure we can use though (due to the issues around our enrichers). Maybe best to catch up for a chat about this one.