getsentry / getsentry/sentry-dotnet
Mobile: User.Other is included in managed errors but not native ones
- Dominant language
- C#
- Stars
- 770
- Forks
- 248
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 49
Description
When using the SDK's C# API to change the Scope, we're able to pass down some fields to the native layer.
So if a crash is caused by Java/Kotlin/Objective-C/Swift/C/C++ etc, it'll include User top level firleds and tags.
How it works: Setting the user in C# triggers the ScopeObserver:
[https://github.com/getsentry/sentry-dotnet/blob/5f0f087f7a33f91ad8df9eb21dbade1eaf368954/src/Sentry/Scope.cs#L120-L139]()
So on iOS for example, we'll set the user as such:
[https://github.com/getsentry/sentry-dotnet/blob/5f0f087f7a33f91ad8df9eb21dbade1eaf368954/src/Sentry/Platforms/Cocoa/CocoaScopeObserver.cs#L92-L103]()
On Android:
[https://github.com/getsentry/sentry-dotnet/blob/5f0f087f7a33f91ad8df9eb21dbade1eaf368954/src/Sentry/Platforms/Android/AndroidScopeObserver.cs#L90-L100]()
And Native (`[sentry-native](https://github.com/getsentry/sentry-native)`):
[https://github.com/getsentry/sentry-dotnet/blob/5f0f087f7a33f91ad8df9eb21dbade1eaf368954/src/Sentry/Platforms/Native/NativeScopeObserver.cs#L30-L39]()
But we don't include everything, and that's not documented anywhere it seems.
For example, we don't sync down to native `User.Other`. And this can be a pitfall to customers.
We need to at least clearly document this, or expand scope sync for this field.
Contributor guide
Assessment
This issue has not been assessed yet.