sentry-unity
sentry-unity copied to clipboard
Context object not shown
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 1.1.0
How did you install the package? (Git-URL)
Which version of Unity? 2021.3.41f
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Either
Steps to Reproduce
I'm setting a context like this (abbreviated):
[Serializable]
public struct AudioStats
{
public double RMS;
}
diag = new Dictionary<string,object>();
// Add various data to diag, e.g.
diag["currentOptions"] = new Dictionary<string,objec>() { "destination": "wss://";
var as = new AudioStats();
as.RMS = -56.12;
diag["currentStats"] = as;
SentrySdk.ConfigureScope(scope =>
{
scope.AddEventProcessor((ev) =>
{
ev.Contexts["someData"] = diag;
return ev;
});
});
Expected Result
In sentry.io I expect to see the serialized nested context for both "currentOptions" and "currentStats".
Actual Result
Only the "currentOptions" propery is shown in sentry.io. The "currentStats" is not.
The documentation is a bit ambigious, it says context as a whole has to be a dictionary or a map, but the example shows the context being set to an object. Then it doesn't say so much about nested structures, but considering it works for a nested dictionary, and it should take something that is serializable, why doesn't it work for a struct?