Count `callback_error` for native Android events when `BeforeSend` throws

Aperta
#5,682 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
android, csharp
Ambito
mobile-dev

Direzione di ricerca

Start at src/Sentry/Platforms/Android/SentrySdk.cs lines 246-255 where BeforeSendWrapper returns null, and at BeforeSendCallback.Execute. The work is explicitly blocked on getsentry/sentry-java#6141 shipping and a Java SDK bump, so nothing is actionable yet: once it ships, bump the sentry-java dependency, then investigate on a physical/emulated Android device whether a thrown Java exception from the callback marshals across JNI so sentry-java counts callback_error instead of before_send. Done means a verified answer (with a device test) and, if it works, the wrapper changed from returning null to throwing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

.NET Bug Platform: Android

Part of #5634.

[Was] blocked by getsentry/sentry-java#6141, and a Java SDK bump to the release that ships it... this is no longer the case.

Branch: main. No public API change, and getsentry/sentry-java#6141 targets sentry-java 8.x, so the fix arrives with a regular Java SDK bump.

When the user's BeforeSend throws on a native Android event, #5610's BeforeSendWrapper returns null (Platforms/Android/SentrySdk.cs:246-255). sentry-java then counts before_send / error (SentryClient.java:171-177). sentry-java 8.58.0 has no callback_error reason yet (DiscardReason.java).

getsentry/sentry-java#6141 (part of getsentry/sentry-java#6081) adds DiscardReason.CALLBACK_ERROR and records it when a beforeSend* callback throws. sentry-java already drops the event on a throw; it just counts it as before_send today.

To investigate once it ships

Instead of returning null, BeforeSendCallback.Execute could throw a Java exception. sentry-java would then drop the event and count callback_error itself. This depends on how .NET for Android marshals managed exceptions across JNI, which needs checking on a device.

Lingua principale
C#
Stelle
775
Fork
262
Merge medio
1g 16h
PR unite (30g)
118

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-dotnet

Tutte le issue di getsentry/sentry-dotnet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.