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.
The text was updated successfully, but these errors were encountered:
Package
Sentry.Maui
.NET Flavor
.NET
.NET Version
9.0.101
OS
Any (not platform specific)
SDK Version
5.0.1
Self-Hosted Sentry Version
No response
Steps to Reproduce
Sentry.Maui.Internal.SentryMauiEventProcessor.Process
methodThrow and Capture Exception
buttonExpected 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, theSentryMauiOptions
configurator,SentryMauiOptionsSetup
, is registered with .NET’s dependency injection container twice — albeit via different means.sentry-dotnet/src/Sentry.Maui/SentryMauiAppBuilderExtensions.cs
Line 48 in 5a83313
sentry-dotnet/src/Sentry.Maui/SentryMauiAppBuilderExtensions.cs
Line 58 in 5a83313
As a consequence,
SentryMauiOptions
gets configured twice (two calls to Sentry.Maui.Internal.SentryMauiOptionsSetup.Configure duringMauiAppBuilder.Build
), two instances ofSentryMauiEventProcessor
are newed-up and added to the processing pipeline (source), and both act on an event.Adding some logging to the
Process
method shows:While this doesn’t appear to have any major side-effects (that I can immediately see) it's probably something that should be fixed.
The text was updated successfully, but these errors were encountered: