Skip to content

Commit

Permalink
deps(react-native): Update bugsnag-cocoa to v6.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Mar 3, 2021
1 parent ed3c137 commit 57162de
Show file tree
Hide file tree
Showing 34 changed files with 391 additions and 68 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Changelog

## TBD

### Changed
## v7.8.1 (2021-02-25)

- (react-native): Update bugsnag-cocoa to v6.7.0
- Identify crashes that occur whilst your app is launching. [bugsnag-cocoa#1004](https://github.com/bugsnag/bugsnag-cocoa/pull/1004)
- Fix inaccurate `app.duration` after multiple calls to `notify()` [bugsnag-cocoa#1014](https://github.com/bugsnag/bugsnag-cocoa/pull/1014)
- Fix a possible deadlock when writing crash reports for unhandled errors. [bugsnag-cocoa#1013](https://github.com/bugsnag/bugsnag-cocoa/pull/1013)

## Changed

- (react-native): Update bugsnag-cocoa to v6.6.4
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ios/.bugsnag-cocoa-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6476eb4cf6a8cc62683f5935b83226658c6ebd90
dc551c901478f23ca81684188e2ae62d98afc26c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bugsnag",
"version": "6.6.4",
"version": "6.7.0",
"summary": "The Bugsnag crash reporting framework for Apple platforms.",
"homepage": "https://bugsnag.com",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
},
"source": {
"git": "https://github.com/bugsnag/bugsnag-cocoa.git",
"tag": "v6.6.4"
"tag": "v6.7.0"
},
"frameworks": [
"Foundation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,17 @@
01B14C56251CE55F00118748 /* report-react-native-promise-rejection.json in Resources */ = {isa = PBXBuildFile; fileRef = 01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */; };
01B14C57251CE55F00118748 /* report-react-native-promise-rejection.json in Resources */ = {isa = PBXBuildFile; fileRef = 01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */; };
01B14C58251CE55F00118748 /* report-react-native-promise-rejection.json in Resources */ = {isa = PBXBuildFile; fileRef = 01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */; };
01B6BB7E25D5777F00FC4DE6 /* BugsnagSwiftPublicAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 008966B02486D43500DC48C2 /* BugsnagSwiftPublicAPITests.swift */; };
01C17AE72542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */; };
01C17AE82542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */; };
01C17AE92542ED7F00C102C9 /* KSCrashReportWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */; };
01CCAEEA25D414D60057268D /* BugsnagLastRunInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 01CCAEE825D414D60057268D /* BugsnagLastRunInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
01CCAEEB25D414D60057268D /* BugsnagLastRunInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 01CCAEE825D414D60057268D /* BugsnagLastRunInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
01CCAEEC25D414D60057268D /* BugsnagLastRunInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 01CCAEE825D414D60057268D /* BugsnagLastRunInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
01CCAEED25D414D60057268D /* BugsnagLastRunInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 01CCAEE925D414D60057268D /* BugsnagLastRunInfo.m */; };
01CCAEEE25D414D60057268D /* BugsnagLastRunInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 01CCAEE925D414D60057268D /* BugsnagLastRunInfo.m */; };
01CCAEEF25D414D60057268D /* BugsnagLastRunInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 01CCAEE925D414D60057268D /* BugsnagLastRunInfo.m */; };
01CCAEF025D414D60057268D /* BugsnagLastRunInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 01CCAEE925D414D60057268D /* BugsnagLastRunInfo.m */; };
01E8765E256684E700F4B70A /* URLSessionMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E8765D256684E700F4B70A /* URLSessionMock.m */; };
01E8765F256684E700F4B70A /* URLSessionMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E8765D256684E700F4B70A /* URLSessionMock.m */; };
01E87660256684E700F4B70A /* URLSessionMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E8765D256684E700F4B70A /* URLSessionMock.m */; };
Expand Down Expand Up @@ -1299,6 +1307,9 @@
0198762E2567D5AB000A7AF3 /* BugsnagStackframe+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagStackframe+Private.h"; sourceTree = "<group>"; };
01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "report-react-native-promise-rejection.json"; sourceTree = "<group>"; };
01C17AE62542ED7F00C102C9 /* KSCrashReportWriterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCrashReportWriterTests.m; sourceTree = "<group>"; };
01CCAEE825D414D60057268D /* BugsnagLastRunInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagLastRunInfo.h; sourceTree = "<group>"; };
01CCAEE925D414D60057268D /* BugsnagLastRunInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BugsnagLastRunInfo.m; sourceTree = "<group>"; };
01CCAEFF25D4151C0057268D /* BugsnagLastRunInfo+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagLastRunInfo+Private.h"; sourceTree = "<group>"; };
01D8EC3C256FC6C3006F2A2D /* BugsnagConfiguration+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BugsnagConfiguration+Private.h"; sourceTree = "<group>"; };
01E8765C256684E700F4B70A /* URLSessionMock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLSessionMock.h; sourceTree = "<group>"; };
01E8765D256684E700F4B70A /* URLSessionMock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = URLSessionMock.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1646,6 +1657,8 @@
00AD1EFD2486A17800A27979 /* BugsnagErrorReportSink.h */,
00AD1EF92486A17700A27979 /* BugsnagErrorReportSink.m */,
01937D01257A7E0E00F2DE31 /* BugsnagErrorReportSink+Private.h */,
01CCAEE925D414D60057268D /* BugsnagLastRunInfo.m */,
01CCAEFF25D4151C0057268D /* BugsnagLastRunInfo+Private.h */,
00AD1EF82486A17700A27979 /* BugsnagSessionTracker.h */,
00AD1F012486A17900A27979 /* BugsnagSessionTracker.m */,
01937D09257A7ED000F2DE31 /* BugsnagSessionTracker+Private.h */,
Expand Down Expand Up @@ -1923,6 +1936,7 @@
3A700A9124A63A8E0068CD1B /* BugsnagError.h */,
3A700A8724A63A8E0068CD1B /* BugsnagErrorTypes.h */,
3A700A8824A63A8E0068CD1B /* BugsnagEvent.h */,
01CCAEE825D414D60057268D /* BugsnagLastRunInfo.h */,
3A700A9324A63A8E0068CD1B /* BugsnagMetadata.h */,
3A700A8324A63A8E0068CD1B /* BugsnagMetadataStore.h */,
3A700A8E24A63A8E0068CD1B /* BugsnagPlugin.h */,
Expand Down Expand Up @@ -2038,6 +2052,7 @@
008969962486DAD100DC48C2 /* BSG_KSBacktrace_Private.h in Headers */,
00896A112486DAD100DC48C2 /* BSG_KSCrashSentry_CPPException.h in Headers */,
008969ED2486DAD100DC48C2 /* BSG_KSCrashDoctor.h in Headers */,
01CCAEEA25D414D60057268D /* BugsnagLastRunInfo.h in Headers */,
01468F5225876DC1002B0519 /* BSGNotificationBreadcrumbs.h in Headers */,
008968ED2486DAB800DC48C2 /* BugsnagFileStore.h in Headers */,
00896A292486DAD100DC48C2 /* BSG_KSCrashType.h in Headers */,
Expand Down Expand Up @@ -2136,6 +2151,7 @@
00896A122486DAD100DC48C2 /* BSG_KSCrashSentry_CPPException.h in Headers */,
008969EE2486DAD100DC48C2 /* BSG_KSCrashDoctor.h in Headers */,
01468F5325876DC1002B0519 /* BSGNotificationBreadcrumbs.h in Headers */,
01CCAEEB25D414D60057268D /* BugsnagLastRunInfo.h in Headers */,
008968EE2486DAB800DC48C2 /* BugsnagFileStore.h in Headers */,
00896A2A2486DAD100DC48C2 /* BSG_KSCrashType.h in Headers */,
008969DC2486DAD100DC48C2 /* BSG_KSCrash.h in Headers */,
Expand Down Expand Up @@ -2234,6 +2250,7 @@
00896A132486DAD100DC48C2 /* BSG_KSCrashSentry_CPPException.h in Headers */,
008969EF2486DAD100DC48C2 /* BSG_KSCrashDoctor.h in Headers */,
01468F5425876DC1002B0519 /* BSGNotificationBreadcrumbs.h in Headers */,
01CCAEEC25D414D60057268D /* BugsnagLastRunInfo.h in Headers */,
008968EF2486DAB800DC48C2 /* BugsnagFileStore.h in Headers */,
00896A2B2486DAD100DC48C2 /* BSG_KSCrashType.h in Headers */,
008969DD2486DAD100DC48C2 /* BSG_KSCrash.h in Headers */,
Expand Down Expand Up @@ -2514,6 +2531,7 @@
008968912486DA9600DC48C2 /* BugsnagError.m in Sources */,
0089687C2486DA9500DC48C2 /* BugsnagBreadcrumb.m in Sources */,
008967FA2486DA4500DC48C2 /* BugsnagApiClient.m in Sources */,
01CCAEED25D414D60057268D /* BugsnagLastRunInfo.m in Sources */,
CBCAF6FD25A457F90095771F /* BSGFileLocations.m in Sources */,
008967DE2486DA2D00DC48C2 /* BSGConfigurationBuilder.m in Sources */,
008968C72486DA9600DC48C2 /* BugsnagApp.m in Sources */,
Expand Down Expand Up @@ -2681,6 +2699,7 @@
0089687D2486DA9500DC48C2 /* BugsnagBreadcrumb.m in Sources */,
008967FB2486DA4500DC48C2 /* BugsnagApiClient.m in Sources */,
008967DF2486DA2D00DC48C2 /* BSGConfigurationBuilder.m in Sources */,
01CCAEEE25D414D60057268D /* BugsnagLastRunInfo.m in Sources */,
CBCAF6FE25A457F90095771F /* BSGFileLocations.m in Sources */,
008968C82486DA9600DC48C2 /* BugsnagApp.m in Sources */,
00AD1F242486A17900A27979 /* Bugsnag.m in Sources */,
Expand Down Expand Up @@ -2846,6 +2865,7 @@
0089687E2486DA9600DC48C2 /* BugsnagBreadcrumb.m in Sources */,
008967FC2486DA4500DC48C2 /* BugsnagApiClient.m in Sources */,
008967E02486DA2D00DC48C2 /* BSGConfigurationBuilder.m in Sources */,
01CCAEEF25D414D60057268D /* BugsnagLastRunInfo.m in Sources */,
CBCAF6FF25A457F90095771F /* BSGFileLocations.m in Sources */,
008968C92486DA9600DC48C2 /* BugsnagApp.m in Sources */,
00AD1F252486A17900A27979 /* Bugsnag.m in Sources */,
Expand Down Expand Up @@ -2939,6 +2959,7 @@
008967592486D43700DC48C2 /* BugsnagClientMirrorTest.m in Sources */,
0089676B2486D43700DC48C2 /* BugsnagSessionTrackerTest.m in Sources */,
E701FAA12490EF4A008D842F /* BugsnagApiValidationTest.m in Sources */,
01B6BB7E25D5777F00FC4DE6 /* BugsnagSwiftPublicAPITests.swift in Sources */,
0089677A2486D43700DC48C2 /* KSMachHeader_Tests.m in Sources */,
0089675F2486D43700DC48C2 /* BugsnagSessionTrackingPayloadTest.m in Sources */,
008967AA2486D43700DC48C2 /* KSCrashIdentifierTests.m in Sources */,
Expand Down Expand Up @@ -3010,6 +3031,7 @@
E7462913248907E500F92D67 /* BSG_KSSignalInfo.c in Sources */,
E7462914248907E500F92D67 /* BSG_KSString.c in Sources */,
E7462915248907E500F92D67 /* BSG_KSObjC.c in Sources */,
01CCAEF025D414D60057268D /* BugsnagLastRunInfo.m in Sources */,
E7462916248907E500F92D67 /* BSG_KSCrashType.c in Sources */,
E7462917248907E500F92D67 /* BSG_KSCrashSentry_User.c in Sources */,
E7462918248907E500F92D67 /* BSG_KSCrashSentry_Signal.c in Sources */,
Expand Down
13 changes: 13 additions & 0 deletions packages/react-native/ios/vendor/bugsnag-cocoa/Bugsnag/Bugsnag.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ + (BOOL)appDidCrashLastLaunch {
return NO;
}

+ (BugsnagLastRunInfo *)lastRunInfo {
if ([self bugsnagStarted]) {
return self.client.lastRunInfo;
}
return nil;
}

+ (void)markLaunchCompleted {
if ([self bugsnagStarted]) {
[self.client markLaunchCompleted];
}
}

+ (void)notify:(NSException *)exception {
if ([self bugsnagStarted]) {
[self.client notify:exception];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// BugsnagLastRunInfo+Private.h
// Bugsnag
//
// Created by Nick Dowell on 10/02/2021.
// Copyright © 2021 Bugsnag Inc. All rights reserved.
//

#include "BugsnagLastRunInfo.h"

@interface BugsnagLastRunInfo ()

- (instancetype)initWithConsecutiveLaunchCrashes:(NSUInteger)consecutiveLaunchCrashes
crashed:(BOOL)crashed
crashedDuringLaunch:(BOOL)crashedDuringLaunch;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// BugsnagLastRunInfo.m
// Bugsnag
//
// Created by Nick Dowell on 10/02/2021.
// Copyright © 2021 Bugsnag Inc. All rights reserved.
//

#import "BugsnagLastRunInfo+Private.h"

@implementation BugsnagLastRunInfo

- (instancetype)initWithConsecutiveLaunchCrashes:(NSUInteger)consecutiveLaunchCrashes
crashed:(BOOL)crashed
crashedDuringLaunch:(BOOL)crashedDuringLaunch {
if (self = [super init]) {
_consecutiveLaunchCrashes = consecutiveLaunchCrashes;
_crashed = crashed;
_crashedDuringLaunch = crashedDuringLaunch;
}
return self;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Foundation/Foundation.h>

#import "BugsnagConfiguration.h"

#define SYSTEMSTATE_KEY_APP @"app"
Expand Down Expand Up @@ -37,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN

- (void)setCodeBundleID:(NSString*)codeBundleID;

@property (nonatomic) NSUInteger consecutiveLaunchCrashes;

/**
* Purge all stored system state.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#import "BugsnagSessionTracker.h"
#import "BugsnagSystemState.h"

static NSString * const ConsecutiveLaunchCrashesKey = @"consecutiveLaunchCrashes";
static NSString * const InternalKey = @"internal";

static NSDictionary* loadPreviousState(BugsnagKVStore *kvstore, NSString *jsonPath) {
NSData *data = [NSData dataWithContentsOfFile:jsonPath];
if(data == nil) {
Expand Down Expand Up @@ -162,6 +165,7 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)config {
_lastLaunchState = loadPreviousState(_kvStore, _persistenceFilePath);
_currentLaunchStateRW = initCurrentState(_kvStore, config);
_currentLaunchState = [_currentLaunchStateRW copy];
_consecutiveLaunchCrashes = [_lastLaunchState[InternalKey][ConsecutiveLaunchCrashesKey] unsignedIntegerValue];
[self sync];

__weak __typeof__(self) weakSelf = self;
Expand Down Expand Up @@ -234,13 +238,21 @@ - (void)setCodeBundleID:(NSString*)codeBundleID {
[self setValue:codeBundleID forAppKey:BSGKeyCodeBundleId];
}

- (void)setConsecutiveLaunchCrashes:(NSUInteger)consecutiveLaunchCrashes {
[self setValue:@(_consecutiveLaunchCrashes = consecutiveLaunchCrashes) forKey:ConsecutiveLaunchCrashesKey inSection:InternalKey];
}

- (void)setValue:(id)value forAppKey:(NSString *)key {
[self setValue:value forKey:key inSection:SYSTEMSTATE_KEY_APP];
}

- (void)setValue:(id)value forKey:(NSString *)key inSection:(NSString *)section {
[self mutateLaunchState:^(NSMutableDictionary *state) {
state[section][key] = value;
if (state[section]) {
state[section][key] = value;
} else {
state[section] = [NSMutableDictionary dictionaryWithObjectsAndKeys:value, key, nil];
}
}];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#import "BugsnagEvent+Private.h"
#import "BugsnagHandledState.h"
#import "BugsnagKeys.h"
#import "BugsnagLastRunInfo+Private.h"
#import "BugsnagLogger.h"
#import "BugsnagMetadata+Private.h"
#import "BugsnagNotifier.h"
Expand Down Expand Up @@ -220,9 +221,13 @@ void BSGWriteSessionCrashData(BugsnagSession *session) {
@interface BugsnagClient () <BSGBreadcrumbSink>

@property BSGNotificationBreadcrumbs *notificationBreadcrumbs;
@property (weak) NSTimer *appLaunchTimer;

@end

#if __clang_major__ >= 11 // Xcode 10 does not like the following attribute
__attribute__((annotate("oclint:suppress[long class]")))
#endif
@implementation BugsnagClient

/**
Expand All @@ -236,7 +241,7 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)configuration {
if ((self = [super init])) {
// Take a shallow copy of the configuration
_configuration = [configuration copy];
self.state = [[BugsnagMetadata alloc] init];
_state = [[BugsnagMetadata alloc] initWithDictionary:@{BSGKeyApp: @{BSGKeyIsLaunching: @YES}}];
self.notifier = [BugsnagNotifier new];
self.systemState = [[BugsnagSystemState alloc] initWithConfiguration:self.configuration];

Expand Down Expand Up @@ -405,6 +410,43 @@ - (void)start {
// notification not received in time on initial startup, so trigger manually
[self willEnterForeground:self];
[self.pluginClient loadPlugins];

if (self.configuration.launchDurationMillis > 0) {
self.appLaunchTimer = [NSTimer scheduledTimerWithTimeInterval:self.configuration.launchDurationMillis / 1000.0
target:self selector:@selector(appLaunchTimerFired:)
userInfo:nil repeats:NO];
}

if (self.lastRunInfo.crashedDuringLaunch && self.configuration.sendLaunchCrashesSynchronously) {
[self sendLaunchCrashSynchronously];
}
}

- (void)appLaunchTimerFired:(NSTimer *)timer {
[self markLaunchCompleted];
}

- (void)markLaunchCompleted {
bsg_log_debug(@"App has finished launching");
[self.appLaunchTimer invalidate];
[self.state addMetadata:@NO withKey:BSGKeyIsLaunching toSection:BSGKeyApp];
}

- (void)sendLaunchCrashSynchronously {
if (self.configuration.session.delegateQueue == NSOperationQueue.currentQueue) {
bsg_log_warn(@"Cannot send launch crash synchronously because session.delegateQueue is set to the current queue.");
return;
}
bsg_log_info(@"Sending launch crash synchronously.");
dispatch_time_t deadline = dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC);
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
[[BSG_KSCrash sharedInstance] sendLatestReport:^{
bsg_log_debug(@"Sent launch crash.");
dispatch_semaphore_signal(semaphore);
}];
if (dispatch_semaphore_wait(semaphore, deadline)) {
bsg_log_debug(@"Timed out waiting for launch crash to be sent.");
}
}

- (BOOL)shouldReportOOM {
Expand Down Expand Up @@ -503,8 +545,21 @@ - (void)computeDidCrashLastLaunch {
unlink(crashSentinelPath);
}
}
self.appDidCrashLastLaunch = handledCrashLastLaunch || didOOMLastLaunch;

BOOL didCrash = handledCrashLastLaunch || didOOMLastLaunch;
self.appDidCrashLastLaunch = didCrash;

BOOL wasLaunching = [self.stateMetadataFromLastLaunch[BSGKeyApp][BSGKeyIsLaunching] boolValue];
BOOL didCrashDuringLaunch = didCrash && wasLaunching;
if (didCrashDuringLaunch) {
self.systemState.consecutiveLaunchCrashes++;
} else {
self.systemState.consecutiveLaunchCrashes = 0;
}

self.lastRunInfo = [[BugsnagLastRunInfo alloc] initWithConsecutiveLaunchCrashes:self.systemState.consecutiveLaunchCrashes
crashed:didCrash
crashedDuringLaunch:didCrashDuringLaunch];

// Ignore potential false positive OOM if previous session crashed and was
// reported. There are two checks in place:
//
Expand Down Expand Up @@ -533,6 +588,10 @@ - (void)setCodeBundleId:(NSString *)codeBundleId {
self.sessionTracker.codeBundleId = codeBundleId;
}

- (void)setLastRunInfo:(BugsnagLastRunInfo *)lastRunInfo {
_lastRunInfo = lastRunInfo;
}

- (void)setStarted:(BOOL)started {
_started = started;
}
Expand Down Expand Up @@ -1098,9 +1157,9 @@ - (void)clearMetadataFromSection:(NSString *_Nonnull)sectionName
// MARK: - event data population

- (BugsnagAppWithState *)generateAppWithState:(NSDictionary *)systemInfo {
return [BugsnagAppWithState appWithDictionary:@{@"system": systemInfo}
config:self.configuration
codeBundleId:self.codeBundleId];
// Replicate the parts of a KSCrashReport that +[BugsnagAppWithState appWithDictionary:config:codeBundleId:] examines
NSDictionary *kscrashDict = @{BSGKeySystem: systemInfo, @"user": @{@"state": [self.state deepCopy].dictionary}};
return [BugsnagAppWithState appWithDictionary:kscrashDict config:self.configuration codeBundleId:self.codeBundleId];
}

- (BugsnagDeviceWithState *)generateDeviceWithState:(NSDictionary *)systemInfo {
Expand Down
Loading

0 comments on commit 57162de

Please sign in to comment.