Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI: SetBeforeSend fails to be called for certain messages #3883

Open
cagriy opened this issue Jan 11, 2025 · 2 comments
Open

MAUI: SetBeforeSend fails to be called for certain messages #3883

cagriy opened this issue Jan 11, 2025 · 2 comments

Comments

@cagriy
Copy link

cagriy commented Jan 11, 2025

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Raising this issue as per support team's recommendation on case 141760

  1. Clone: https://github.com/cagriy/SentryFilter/tree/main/SentryFilter
  2. Add your DSN on MauiProgram.cs line 17
  3. Put a breakpoint on MainPage.xaml.cs, line 23
  4. Start debugging
  5. When it stops at the breakpoint, wait 10 seconds
  6. Resume execution
  7. Confirm App Hanging message is received on the sentry console
  8. Check if relevant DEBUG messages exist

Expected Result

In the case of an App Hanging event, although a message is successfully sent to the Sentry backend, SetBeforeSend does not get called.

Expected Result: SetBeforeSend should be called for all messages sent.

Note: SetBeforeSend gets called for most messages but not for App Hanging

Actual Result

SetBeforeSend does not get called

Product Area

Ingestion and Filtering

Link

No response

DSN

4506310016958464

Version

4.11

@getsantry
Copy link

getsantry bot commented Jan 11, 2025

Assigning to @getsentry/support for routing ⏲️

@Kobby-Bawuah Kobby-Bawuah transferred this issue from getsentry/sentry Jan 11, 2025
@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 11, 2025
@jamescrosswell
Copy link
Collaborator

Hi @cagriy - thanks for the detailed report.

This looks like something that hasn't yet been implemented in the Cocoa integration:

// TODO: Finish SentryEventExtensions to enable these
// if (options.Native.EnableBeforeSend && options.BeforeSend is { } beforeSend)
// {
// nativeOptions.BeforeSend = evt =>
// {
// var sentryEvent = evt.ToSentryEvent(nativeOptions);
// var result = beforeSend(sentryEvent)?.ToCocoaSentryEvent(options, nativeOptions);
//
// // Note: Nullable result is allowed but delegate is generated incorrectly
// // See https://github.com/xamarin/xamarin-macios/issues/15299#issuecomment-1201863294
// return result!;
// };
// }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants