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
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:
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.
The text was updated successfully, but these errors were encountered:
Documenting the pitfall won't fix bad UX. And looking at what sentry-native allows us to do we should sync down Other.
Don't hang me for my native code but something like this should work:
sentry_value_t user = sentry_value_new_object();
sentry_value_t other = sentry_value_new_object()
sentry_value_set_by_key(other, "my_key", sentry_value_new_string("my_value"));
// add all the stuff
sentry_value_set_by_key(user, "contexts", other);
sentry_set_user(user);
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:
sentry-dotnet/src/Sentry/Scope.cs
Lines 120 to 139 in 5f0f087
So on iOS for example, we'll set the user as such:
sentry-dotnet/src/Sentry/Platforms/Cocoa/CocoaScopeObserver.cs
Lines 92 to 103 in 5f0f087
On Android:
sentry-dotnet/src/Sentry/Platforms/Android/AndroidScopeObserver.cs
Lines 90 to 100 in 5f0f087
And Native (
[sentry-native](https://github.com/getsentry/sentry-native)
):sentry-dotnet/src/Sentry/Platforms/Native/NativeScopeObserver.cs
Lines 30 to 39 in 5f0f087
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.
The text was updated successfully, but these errors were encountered: