iOS: previous-run native crash reports can bypass SetBeforeSend

Đang mở
#5,765 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
1-2 ngày
Mức phù hợp với người mới
49/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
backend, observability-sre

Hướng nghiên cứu

Read src/Sentry/SentrySdk.cs and src/Sentry/Platforms/Cocoa/SentrySdk.cs, especially InitHub and ProcessOnBeforeSend, then inspect SentryEventHelper.DoBeforeSend and related tests. Reproduce how a previous-run native crash report is processed before the managed Hub exists. Done when BeforeSend runs for that report while scope event processors are skipped until the Hub is ready, with tests covering the behavior.

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

Mô tả

Bug Platform: iOS State: Needs Discussion

On iOS / Mac Catalyst, native crash reports from the previous run can be sent without the user's SetBeforeSend (or managed event processors) running.

InitHub initializes the Cocoa SDK before the managed Hub exists. The Cocoa SDK can process stored crash reports during that window (confirmed here). They reach ProcessOnBeforeSend, where CurrentHub is still a DisabledHub, which returns the event unchanged:

// If the SDK is disabled, there are no event processors or before send to run.
if (hub is DisabledHub)
{
    return evt;
}

The previous-run crash is the one event most likely to carry data a user's BeforeSend is meant to redact. The docs for OnCrashedLastRun also say that event can be dropped by SetBeforeSend.

Possible fix

SentryEventHelper.DoBeforeSend only needs options, not the hub. When the hub isn't ready, still convert the event and run BeforeSend; skip only the scope event processors. Event processors added via options.AddEventProcessor could run too.

Reported in #5733.

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.