Skip to content

Conversation

@aritchie
Copy link
Contributor

@aritchie aritchie commented Feb 11, 2025

Resolves #2102

@aritchie aritchie mentioned this pull request Feb 12, 2025
@aritchie
Copy link
Contributor Author

@jamescrosswell @bruno-garcia Native exceptions obviously teardown the MAUI apps. I can't unit test this properly due to needing to shutdown the app. Thoughts? Any internal mechanism I can call in native to have it "pretend" an issue occurred previously and force run BeforeSend/CrashedLastRun

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Feb 14, 2025

Over at https://github.com/getsentry/sentry-unity/ we're covering this via smoketests which to me seems more reliable to guarantee native-crash capture.
Two runs:

  1. Running and crashing on purpose
  2. Running again and expecting the crashedLastRun to be true

@jamescrosswell
Copy link
Collaborator

@jamescrosswell @bruno-garcia Native exceptions obviously teardown the MAUI apps. I can't unit test this properly due to needing to shutdown the app. Thoughts? Any internal mechanism I can call in native to have it "pretend" an issue occurred previously and force run BeforeSend/CrashedLastRun

I think the CrashedLastRun mechanism will ultimately be checking to see if there's an envelope for a crash report somewhere right? So that we could fake/mock?

@aritchie
Copy link
Contributor Author

I think the CrashedLastRun mechanism will ultimately be checking to see if there's an envelope for a crash report somewhere right? So that we could fake/mock?

Can't really fake/mock the native layer though. This is smoke tested in the iOS sample app.

@aritchie aritchie marked this pull request as ready for review February 18, 2025 16:39
@aritchie aritchie marked this pull request as draft February 18, 2025 23:13
@aritchie
Copy link
Contributor Author

This PR also now resolves #735 and #3944

@aritchie aritchie marked this pull request as ready for review February 21, 2025 16:05
@jamescrosswell jamescrosswell linked an issue Mar 2, 2025 that may be closed by this pull request
@aritchie aritchie merged commit bdbad69 into main Mar 3, 2025
@aritchie aritchie deleted the 2102-ios_beforesend_oncrashedlastrun branch March 3, 2025 22:24
if (levelString == null)
return null;

// Native SentryLevel.None does not exist in dotnet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know what the behaviour of SentryLevel.None is? Does it mean nothing gets logged? Is that was setting the level = null does?

"warning" => SentryLevel.Warning,
"fatal" => SentryLevel.Fatal,
"error" => SentryLevel.Error,
_ => null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it this is intentional (we don't want to throw an exception but we can't conveniently log the irregularity anywhere)?

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

Labels

None yet

Projects

None yet

5 participants