getsentry / sentry-xamarin

Sentry for Xamarin Native and Xamarin.Forms
https://docs.sentry.io/platforms/dotnet/guides/xamarin/
44 stars 11 forks source link

Discuss CancelationToken on FormsApplicationListener #109

Open lucas-zimerman opened 2 years ago

lucas-zimerman commented 2 years ago

To not lose the comment from Matt

https://github.com/getsentry/sentry-xamarin/pull/108#pullrequestreview-932694614

Yikes. I see this was in the old code and you are just refactoring, but we really shouldn't completely lose this task. It should be saved somewhere. We should also register it for cancellation so it can be shut down gracefully. I'm OK if this is done in a future PR, but wanted to point it out.

On https://github.com/getsentry/sentry-xamarin/blob/6c15473b6ddaa10afc0274cd131cb2a612628361/Src/Sentry.Xamarin.Forms/Internals/FormsApplicationListener.cs#L30-L45

bruno-garcia commented 2 years ago

Task.Run() should have the value assigned somewhere and the result/exception inspected, or at least a whole try/catch in the body handling any error (we should do this anyway). Also we could go with ContinuesWith(...)