Count `callback_error` for native iOS events when a managed callback throws

Open
#5,683 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
csharp, swift
Domain
devtools

Research direction

Blocked on getsentry/sentry-cocoa#8993 — first confirm whether that ships and in which sentry-cocoa major, since the issue explicitly defers all work until then. Then trace where .NET forwards native iOS events through the Cocoa bindings (event processor / BeforeSend path) and check on a device how .NET for iOS marshals a managed exception thrown as an NSException instead of returning nil. Done when a managed throw on a native event is dropped and counted as callback_error by sentry-cocoa, not before_send.

Written by the indexing model from the issue text.

Description

.NET Blocked Bug Platform: iOS

Part of #5634. Blocked by getsentry/sentry-cocoa#8993.

Branch: main. No public API change. If getsentry/sentry-cocoa#8993 only ships in a new sentry-cocoa major, this moves to version7 with that bump.

When a managed event processor or BeforeSend throws on a native iOS event, sentry-cocoa counts the drop as before_send. sentry-cocoa 9.29.2 has no callback_error reason yet (SentryDiscardReason.swift). Once #5681 stops .NET recording its own count for native events, a throw only shows up as before_send until this is done.

getsentry/sentry-cocoa#8993 plans an @try/@catch boundary around SentryObjC callbacks, which is the layer the .NET bindings use, and client reports for failures that drop telemetry.

To investigate once it ships

Instead of returning nil, the Cocoa block could raise an NSException. sentry-cocoa would then drop the event and count callback_error itself. This depends on how .NET for iOS marshals managed exceptions across Objective-C, which needs checking on a device.

Dominant language
C#
Stars
775
Forks
262
Avg merge
1d 16h
Merged PRs (30d)
118

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-dotnet

All issues in getsentry/sentry-dotnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.