Skip to content

Revert unintentional changes to Shell breadcrumb tests

cd8b52b
Select commit
Loading
Failed to load commit list.
Open

feat: Automatic trace instrumentation for MAUI #5138

Revert unintentional changes to Shell breadcrumb tests
cd8b52b
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Apr 22, 2026 in 14m 10s

3 issues

find-bugs: Found 3 issues (1 medium, 2 low)

Medium

Navigation span never finished when resolved route is null - `src/Sentry.Maui/Internal/MauiEventsBinder.cs:582-585`

In OnShellOnNavigated, when e.Current?.Location is null and EnableAutoTransactions is true, the method returns early at line 584 without calling FinishNavigationSpan(). However, OnShellOnNavigating would have already started a navigation span via StartNavigationSpan(). This leaves the span in an unfinished state, causing a resource leak where the span remains open until some other event (like another navigation, window stop, or button click) happens to close it.

Also found at:

  • test/Sentry.Maui.Tests/MauiEventsBinderTests.Shell.cs:127-146
  • test/Sentry.Maui.Tests/MauiEventsBinderTests.Shell.cs:215

Low

Error log never executes due to null-conditional on HubAdapter.GetSentryOptions() - `src/Sentry/SentrySdk.cs:215`

When UseHub is called with a HubAdapter, the code attempts to log an error via hub.GetSentryOptions()?.LogError(...). However, GetSentryOptions() on HubAdapter delegates to SentrySdk.CurrentOptions, which calls CurrentHub.GetSentryOptions(). At this point, CurrentHub is still DisabledHub.Instance (or the previous hub), and DisabledHub returns null for GetSentryOptions(). This means the error message will never be logged, making the diagnostic message dead code.

Also found at:

  • src/Sentry/TransactionTracer.cs:332-338
Test method name contains accidental double underscore typo - `test/Sentry.Maui.Tests/MauiEventsBinderTests.Window.cs:182`

The test method name was changed from Window_PopCanceled_AddsBreadcrumb to Window_PopCanceled__AddsBreadcrumb, introducing a double underscore (__) which is inconsistent with all other test methods in the file that use single underscores as separators. This is likely an accidental typo rather than an intentional change.


Duration: 14m 1s · Tokens: 10.5M in / 104.8k out · Cost: $15.21 (+extraction: $0.01, +merge: $0.00, +fix_gate: $0.01)

Annotations

Check warning on line 585 in src/Sentry.Maui/Internal/MauiEventsBinder.cs

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

Navigation span never finished when resolved route is null

In `OnShellOnNavigated`, when `e.Current?.Location` is null and `EnableAutoTransactions` is true, the method returns early at line 584 without calling `FinishNavigationSpan()`. However, `OnShellOnNavigating` would have already started a navigation span via `StartNavigationSpan()`. This leaves the span in an unfinished state, causing a resource leak where the span remains open until some other event (like another navigation, window stop, or button click) happens to close it.

Check warning on line 146 in test/Sentry.Maui.Tests/MauiEventsBinderTests.Shell.cs

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

[8EP-PRH] Navigation span never finished when resolved route is null (additional location)

In `OnShellOnNavigated`, when `e.Current?.Location` is null and `EnableAutoTransactions` is true, the method returns early at line 584 without calling `FinishNavigationSpan()`. However, `OnShellOnNavigating` would have already started a navigation span via `StartNavigationSpan()`. This leaves the span in an unfinished state, causing a resource leak where the span remains open until some other event (like another navigation, window stop, or button click) happens to close it.

Check warning on line 215 in test/Sentry.Maui.Tests/MauiEventsBinderTests.Shell.cs

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

[8EP-PRH] Navigation span never finished when resolved route is null (additional location)

In `OnShellOnNavigated`, when `e.Current?.Location` is null and `EnableAutoTransactions` is true, the method returns early at line 584 without calling `FinishNavigationSpan()`. However, `OnShellOnNavigating` would have already started a navigation span via `StartNavigationSpan()`. This leaves the span in an unfinished state, causing a resource leak where the span remains open until some other event (like another navigation, window stop, or button click) happens to close it.