Android: native events are sent unfiltered when BeforeSend conversion fails
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
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
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-dotnet
-
Install tzdata in the Alpine CI image so time zone tests run on muslPossibly taken @schalkpienaar claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getsentry/sentry-dotnet#5756 · 1 comment ·
Maintainers usually reply within 1 day
-
docs: list supported versions in the MAUI guide and remove TizenPossibly taken @ric-oliv claimed this 14 days ago. Open.NET Docs Framework: MAUI
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
getsentry/sentry-dotnet#5714 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Document the release and environment changes for v7.0.0Possibly taken @jamescrosswell claimed this 15 days ago. Open.NET Docs Next Major
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
getsentry/sentry-dotnet#5709 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Docs MSBuild Needs Docs Update
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-dotnet#5691 · 1 comment ·
Maintainers usually reply within 1 day
-
.NET Docs State: Needs Discussion
Difficulty 1/5 Under an hour Newbie friendliness 82/100
getsentry/sentry-dotnet#5637 · 1 comment ·
Maintainers usually reply within 1 day
All issues in getsentry/sentry-dotnet
Similar issues
-
devtools documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Azure.Identity bug Client
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/azure-sdk-for-net#64293 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Live-Charts/LiveCharts2#2403 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-feature/dotnet-sdk#847 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100