Skip to content

Commit

Permalink
fix: Crashed session not being reported as crashed (#3183)
Browse files Browse the repository at this point in the history
Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
  • Loading branch information
brustolin and getsentry-bot committed Jul 24, 2023
1 parent ed68562 commit 32c4446
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
### Fixes

- Reclaim memory used by profiler when transactions are discarded (#3154)
- Crashed session not being reported as crashed (#3183)

## 8.9.2

Expand Down
4 changes: 3 additions & 1 deletion Sources/Sentry/SentryOptions.m
Expand Up @@ -54,8 +54,11 @@ - (void)setMeasurement:(SentryMeasurementValue *)measurement

+ (NSArray<NSString *> *)defaultIntegrations
{
// The order of integrations here is important.
// SentryCrashIntegration needs to be initialized before SentryAutoSessionTrackingIntegration.
NSMutableArray<NSString *> *defaultIntegrations =
@[
NSStringFromClass([SentryCrashIntegration class]),
#if SENTRY_HAS_UIKIT
NSStringFromClass([SentryAppStartTrackingIntegration class]),
NSStringFromClass([SentryFramesTrackingIntegration class]),
Expand All @@ -69,7 +72,6 @@ - (void)setMeasurement:(SentryMeasurementValue *)measurement
NSStringFromClass([SentryAutoBreadcrumbTrackingIntegration class]),
NSStringFromClass([SentryAutoSessionTrackingIntegration class]),
NSStringFromClass([SentryCoreDataTrackingIntegration class]),
NSStringFromClass([SentryCrashIntegration class]),
NSStringFromClass([SentryFileIOTrackingIntegration class]),
NSStringFromClass([SentryNetworkTrackingIntegration class]),
NSStringFromClass([SentrySwiftAsyncIntegration class])
Expand Down
6 changes: 6 additions & 0 deletions Tests/SentryTests/SentryOptionsTest.m
Expand Up @@ -394,6 +394,12 @@ - (void)testDefaultIntegrations
@"Default integrations are not set correctly");
}

- (void)testSentryCrashIntegrationIsFirst
{
XCTAssertEqualObjects(SentryOptions.defaultIntegrations.firstObject,
NSStringFromClass([SentryCrashIntegration class]));
}

- (void)testSampleRateWithDict
{
NSNumber *sampleRate = @0.1;
Expand Down

0 comments on commit 32c4446

Please sign in to comment.