This came up a few times, more recently on SO:
https://stackoverflow.com/questions/65066020/c-xamarin-forms-and-sentrysdk-context-info-not-making-it-to-sentry-errors
Currently the Hub is stored in a AsyncLocal field so data forks on new asynchronous flows.
This causes problems for Desktop and Mobile apps that want to push work to a back ground thread but would like that data available in case of an error anywhere.
This is how the Android and iOS SDKs of Sentry work, with a static global Hub.
An attempt to simulate that happened in this PR #448 but we the general approach needs to be discussed.
Resolves: #221
More context: https://forum.sentry.io/t/accessing-and-ensuring-global-shared-scope-in-net/11709/2
This came up a few times, more recently on SO:
https://stackoverflow.com/questions/65066020/c-xamarin-forms-and-sentrysdk-context-info-not-making-it-to-sentry-errors
Currently the Hub is stored in a AsyncLocal field so data forks on new asynchronous flows.
This causes problems for Desktop and Mobile apps that want to push work to a back ground thread but would like that data available in case of an error anywhere.
This is how the Android and iOS SDKs of Sentry work, with a static global Hub.
An attempt to simulate that happened in this PR #448 but we the general approach needs to be discussed.
Resolves: #221
More context: https://forum.sentry.io/t/accessing-and-ensuring-global-shared-scope-in-net/11709/2