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
Place a break point anywhere in the Sentry.Maui.Internal.SentryMauiEventProcessor.Process method
Tap Throw and Capture Exception button
Expected Result
I expect only one instance of SentryMauiEventProcessor to exist and process the event.
Actual Result
Two instances of SentryMauiEventProcessor exist and both process the event.
Notes:
When a .NET MAUI app calls either of the MauiAppBuilder.UseSentry overloads, the SentryMauiOptions configurator, SentryMauiOptionsSetup, is registered with .NET’s dependency injection container twice — albeit via different means.
As a consequence, SentryMauiOptions gets configured twice (two calls to Sentry.Maui.Internal.SentryMauiOptionsSetup.Configure during MauiAppBuilder.Build), two instances of SentryMauiEventProcessor are newed-up and added to the processing pipeline (source), and both act on an event.
Adding some logging to the Process method shows:
Info: SentryMauiEventProcessor with InstanceId: 12af7053-540e-43d6-a866-37d784dde85d processed EventId: 0b6f8c02a7604555a14c08627402839a
Info: SentryMauiEventProcessor with InstanceId: 95fae520-c882-499d-8bcc-85670c331948 processed EventId: 0b6f8c02a7604555a14c08627402839a
While this doesn’t appear to have any major side-effects (that I can immediately see) it's probably something that should be fixed.
Activity
jamescrosswell commentedon Jan 16, 2025
Nice catch @phunkeler ! Thanks for reporting this.
jamescrosswell commentedon Jan 20, 2025
Related issue:
IConfigureOptions<SentryAspNetCoreOptions>#3906