Skip to content
This repository was archived by the owner on Sep 14, 2020. It is now read-only.

Commit 101c223

Browse files
committed
feat: Upgrade bugsnag-cocoa to v5.22.1
1 parent 7660b02 commit 101c223

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

cocoa/vendor/bugsnag-cocoa/Source/BSGOutOfMemoryWatchdog.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ - (BOOL)computeDidOOMLastLaunchWithConfig:(BugsnagConfiguration *)config {
146146
NSDictionary *lastBootInfo = [self readSentinelFile];
147147
if (lastBootInfo != nil) {
148148
self.lastBootCachedFileInfo = lastBootInfo;
149+
NSString *lastBootBundleVersion =
150+
[lastBootInfo valueForKeyPath:@"app.bundleVersion"];
149151
NSString *lastBootAppVersion =
150152
[lastBootInfo valueForKeyPath:@"app.version"];
151153
NSString *lastBootOSVersion =
@@ -154,9 +156,12 @@ - (BOOL)computeDidOOMLastLaunchWithConfig:(BugsnagConfiguration *)config {
154156
[[lastBootInfo valueForKeyPath:@"app.inForeground"] boolValue];
155157
NSString *osVersion = [BSG_KSSystemInfo osBuildVersion];
156158
NSDictionary *appInfo = [[NSBundle mainBundle] infoDictionary];
159+
NSString *bundleVersion =
160+
[appInfo valueForKey:@BSG_KSSystemField_BundleVersion];
157161
NSString *appVersion =
158-
[appInfo valueForKey:(__bridge NSString *)kCFBundleVersionKey];
162+
[appInfo valueForKey:@BSG_KSSystemField_BundleShortVersion];
159163
BOOL sameVersions = [lastBootOSVersion isEqualToString:osVersion] &&
164+
[lastBootBundleVersion isEqualToString:bundleVersion] &&
160165
[lastBootAppVersion isEqualToString:appVersion];
161166
BOOL shouldReport = config.reportOOMs && (config.reportBackgroundOOMs || lastBootInForeground);
162167
[self deleteSentinelFile];
@@ -214,7 +219,8 @@ - (NSMutableDictionary *)generateCacheInfoWithConfig:(BugsnagConfiguration *)con
214219
app[@"id"] = systemInfo[@BSG_KSSystemField_BundleID] ?: @"";
215220
app[@"name"] = systemInfo[@BSG_KSSystemField_BundleName] ?: @"";
216221
app[@"releaseStage"] = config.releaseStage;
217-
app[@"version"] = systemInfo[@BSG_KSSystemField_BundleVersion] ?: @"";
222+
app[@"version"] = systemInfo[@BSG_KSSystemField_BundleShortVersion] ?: @"";
223+
app[@"bundleVersion"] = systemInfo[@BSG_KSSystemField_BundleVersion] ?: @"";
218224
app[@"inForeground"] = @YES;
219225
#if TARGET_OS_TV
220226
app[@"type"] = @"tvOS";

cocoa/vendor/bugsnag-cocoa/Source/BugsnagNotifier.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#import <AppKit/AppKit.h>
4545
#endif
4646

47-
NSString *const NOTIFIER_VERSION = @"5.22.0";
47+
NSString *const NOTIFIER_VERSION = @"5.22.1";
4848
NSString *const NOTIFIER_URL = @"https://github.com/bugsnag/bugsnag-cocoa";
4949
NSString *const BSTabCrash = @"crash";
5050
NSString *const BSAttributeDepth = @"depth";

cocoa/vendor/bugsnag-cocoa/Source/KSCrash/Source/KSCrash/Recording/Sentry/BSG_KSCrashSentry_User.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,23 @@ void bsg_kscrashsentry_reportUserException(const char *name,
6464
BSG_KSLOG_WARN("User-reported exception sentry is not installed. "
6565
"Exception has not been recorded.");
6666
} else {
67+
// We want these variables to persist until the onCrash
68+
// call later
69+
int callstackCount = 100;
70+
uintptr_t callstack[callstackCount];
71+
6772
bsg_kscrashsentry_beginHandlingCrash(bsg_g_context);
6873

6974
if (bsg_g_context->suspendThreadsForUserReported) {
7075
BSG_KSLOG_DEBUG("Suspending all threads");
7176
bsg_kscrashsentry_suspendThreads();
7277
}
7378

74-
7579
if (stackAddresses != NULL && stackLength > 0) {
7680
bsg_g_context->stackTrace = stackAddresses;
7781
bsg_g_context->stackTraceLength = (int)stackLength;
7882
} else {
7983
BSG_KSLOG_DEBUG("Fetching call stack.");
80-
int callstackCount = 100;
81-
uintptr_t callstack[callstackCount];
8284
callstackCount = backtrace((void **)callstack, callstackCount);
8385
if (callstackCount <= 0) {
8486
BSG_KSLOG_ERROR("backtrace() returned call stack length of %d",

0 commit comments

Comments
 (0)