Skip to content

Count callback_error for native iOS events when a managed callback throws #5683

Open

Description

@jamescrosswell

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeBlockedBugSomething isn't workingPlatform: iOS

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions