iOS: previous-run native crash reports can bypass SetBeforeSend
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 49/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- backend, observability-sre
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 775
- Forks
- 262
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 118
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
-
chore: remove stale IL3050/IL3053 workaround from the iOS samplePossibly taken A pull request linked to this issue is open or already merged. OpenState: Needs Discussion
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-dotnet#6071 · 1 comment ·
Maintainers usually reply within 1 day
-
Heap dumps: every SDK shutdown logs "Error waiting for GarbageCollectionMonitor task to complete"Possibly taken @pcbeingused33 claimed this today. OpenState: Needs Discussion
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-dotnet#6039 · 3 comments ·
Maintainers usually reply within 1 day
-
.NET Platform: Android Task
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-dotnet#6020 · 3 comments ·
Maintainers usually reply within 1 day
-
Move the Blazor WebAssembly sample off the deprecated DevServerPossibly taken A pull request linked to this issue is open or already merged. Open.NET Framework: Blazor
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
getsentry/sentry-dotnet#5906 · 1 comment · 1 reaction ·
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
All issues in getsentry/sentry-dotnet
Similar issues
-
In-car displays show 0 km/h and P while the AV drivesPossibly taken @bazilinskyy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bazilinskyy/coupled-sim#366 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BaryoDev/umbraco-pwa#196 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
microsoft/fluentui-blazor#5688 ·
Maintainers usually reply within 1 day
-
bug flaky lsp-transport small
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day