sentry-cocoa: Crash reports not emitted when client is re-started

Platform

macOS

Installed

Carthage

Version

7.6.1 (also tried bumping to latest 7.31.2, issue persists)

Steps to Reproduce

  1. Start SDK integration with [SentrySDK startWithConfigureOptions ...] on app startup
  2. At some point during application, call [SentrySDK close] to stop crash reporting
  3. Re-initialize the SDK integration with [SentrySDK startWithConfigureOptions ...]
  4. Manually crash app (e.g. [SentrySDK crash])
  5. Observe that no crash report is omitted.

Note that if a crash is manually triggered between steps 1 and 2, a crash report is properly emitted as expected.

I also messaged the Sentry Community Discord about this but received no response (see message here).

Copied from my message:

Based on a bit of digging, it looks like the state of the SentryCrash/SentryCrashWrapper is never reset after it’s modified in close(), even if SentryCrashIntegration is reinstalled (e.g. here), as would be done when the client is re-initialized.

Expected Result

Crash report is emitted even after SDK is restarted.

Actual Result

Crash report is not emitted even after SDK is restarted.

Note that this behavior is implemented properly in the Sentry Rust SDK, which we use in the same binary (our app is a native macOS app built in Rust).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Thats’s wonderful. Much appreciated!

That doesn’t do anything on the second install.