sentry-dotnet
sentry-dotnet copied to clipboard
Investigate Blazor+MAUI hybrid apps
Problem Statement
Looks like MAUI Blazor hybrid apps are getting popular.
- https://learn.microsoft.com/en-us/aspnet/core/blazor/hybrid/tutorials/maui
- https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/blazorwebview
- https://www.codemag.com/Article/2111092/Blazor-Hybrid-Web-Apps-with-.NET-MAUI
- https://www.youtube.com/watch?v=bnoCU5XGBh4
- https://www.youtube.com/watch?v=v36s9snCrXU
We should see if we can support it OOTB with the Sentry .NET MAUI SDK.
Solution Brainstorm
It may be helpful to bundle the Sentry JavaScript SDK, not sure.
It may be required to sign up to the NavigationManager.LocationChanged
event for tracking page loads, but not sure if there is a good way to track page loading times in general otherwise.
From what we've observed, some JS errors never make it to the .NET side so they have to be logged by the JS SDK. On the other hand, this is also true for many .NET errors; they never make it to the JS console (or if they do, they lack metadata). So you basically need both SDKs.
The main issue is keeping scope in sync via asynchronous IPCs. I think for the most part you only need to push metadata to the JS side, not backwards; maybe even a pull approach could work before sending events to Sentry?
Some de-duplication mechanism is also needed if there are 2 SDKs since some events seem to make it through to both ends of the logging pipeline. Maybe just push events directly from the JS SDK to the .NET SDK and have the .NET side handle the messaging and de-duplication?