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

Đang mở
#5,682 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
android, csharp
Lĩnh vực
mobile-dev

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

.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.

Ngôn ngữ chính
C#
Star
775
Fork
262
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
118

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-dotnet

Tất cả issue của getsentry/sentry-dotnet

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.