Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- `InvalidOperationException` potentially thrown during a race condition, especially in concurrent high-volume logging scenarios ([#4428](https://github.com/getsentry/sentry-dotnet/pull/4428))
- Blocking calls are no longer treated as unhandled crashes ([#4458](https://github.com/getsentry/sentry-dotnet/pull/4458))
- Only apply Session Replay masks to specific control types when necessary to avoid performance issues in MAUI apps with complex UIs ([#4445](https://github.com/getsentry/sentry-dotnet/pull/4445))
- De-duplicate Java.Lang.RuntimeException on Android ([#4509](https://github.com/getsentry/sentry-dotnet/pull/4509))

### Dependencies

Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Platforms/Android/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ private static void InitSentryAndroidSdk(SentryOptions options)
options.CrashedLastRun = () => JavaSdk.Sentry.IsCrashedLastRun()?.BooleanValue() is true;
options.EnableScopeSync = true;
options.ScopeObserver = new AndroidScopeObserver(options);
// Don't capture Java Runtime exceptions in the managed SDK, since we already capture them in the native SDK
options.AddExceptionFilterForType<Java.Lang.RuntimeException>();
Copy link
Member

@Flash0ver Flash0ver Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: test

Is there a (somewhat) straightforward way to (unit) test the suppression of the double capture?

Perhaps via

#if ANDROID
    SentrySdk.CauseCrash(CrashType.Java);
#endif

or would this need to be an integration test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any suitable place for testing this. Native SDKs are not initialized in unit tests, and integration tests only run on desktop platforms. Once we have the infrastructure for e2e tests, though, then we can hopefully start testing these things:


// TODO: Pause/Resume
}
Expand Down
Loading