Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Android: native events are sent unfiltered when BeforeSend conversion fails

Open Beginner friendly
#5,764 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
android, csharp
Domain
mobile

Research direction

Read src/Sentry/Platforms/Android/Callbacks/BeforeSendCallback.cs, especially the conversion catch in BeforeSendCallback.Execute, and check the existing Android tests for this callback. Trace how the Java SDK handles a null result and confirm the expected client report behavior. Done means conversion failures drop the event, with a regression test covering the failure path.

Written by the indexing model from the issue text.

Description

Bug Platform: Android State: Needs Discussion

On Android, when options.Native.EnableBeforeSend is on, a Java/NDK event that can't be converted to or from a managed SentryEvent is sent unfiltered.

BeforeSendCallback.Execute wraps the conversion (ToSentryEvent, ToHint, ToJavaSentryEvent) in a catch that logs and does return e;, so the original Java event goes out without the user's BeforeSend having run.

#5610 already made exceptions thrown by the user's callback drop the event (BeforeSendWrapper returns null), so conversion failures are now the only thing that reaches this catch. It should be consistent with that: return null so the Java SDK drops the event and records the client report.

Users who enable EnableBeforeSend usually do it to redact data from native events, so sending the raw event when filtering can't run defeats the purpose.

Reported in #5733.

Dominant language
C#
Stars
770
Forks
254
Avg merge
1d 14h
Merged PRs (30d)
93

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-dotnet

All issues in getsentry/sentry-dotnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.