Skip to content

Commit

Permalink
Update bugsnag-cocoa to v6.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kstenerud committed Mar 11, 2021
1 parent fbade08 commit e4dade7
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 30 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## TBD

### Bug fixes

- (react-native): Update bugsnag-cocoa to v6.7.1
- Fix `os_proc_available_memory` runtime link error on Mac Catalyst. [bugsnag-cocoa#1025](https://github.com/bugsnag/bugsnag-cocoa/pull/1025)
- Fix missing `osName` and `osVersion` for errors reported from app extensions that do not link against UIKit. [bugsnag-cocoa#1022](https://github.com/bugsnag/bugsnag-cocoa/pull/1022)
- Fix incorrect `freeMemory` for errors reported via `notify()` [bugsnag-cocoa#1021](https://github.com/bugsnag/bugsnag-cocoa/pull/1021)



## v7.8.2 (2021-03-04)

### Changed
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 @@
dc551c901478f23ca81684188e2ae62d98afc26c
bb114d83e676db6a40fbd7911b78a1490b0d57b1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bugsnag",
"version": "6.7.0",
"version": "6.7.1",
"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.7.0"
"tag": "v6.7.1"
},
"frameworks": [
"Foundation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ - (void)startNewSessionWithAutoCaptureValue:(BOOL)isAutoCaptured {
BugsnagApp *app = [BugsnagApp appWithDictionary:@{@"system": systemInfo}
config:self.config
codeBundleId:self.codeBundleId];
BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:@{@"system": systemInfo}];
BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:@{@"system": systemInfo}];
[device appendRuntimeInfo:self.extraRuntimeInfo];

BugsnagSession *newSession = [[BugsnagSession alloc] initWithId:[[NSUUID UUID] UUIDString]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,10 @@ - (void)metadataChanged:(BugsnagMetadata *)metadata {
*/
#if BSG_PLATFORM_IOS
- (void)batteryChanged:(NSNotification *)notification {
if (![UIDEVICE currentDevice]) {
return;
}

NSNumber *batteryLevel = @([UIDEVICE currentDevice].batteryLevel);
BOOL charging = [UIDEVICE currentDevice].batteryState == UIDeviceBatteryStateCharging ||
[UIDEVICE currentDevice].batteryState == UIDeviceBatteryStateFull;
Expand Down Expand Up @@ -1163,7 +1167,7 @@ - (BugsnagAppWithState *)generateAppWithState:(NSDictionary *)systemInfo {
}

- (BugsnagDeviceWithState *)generateDeviceWithState:(NSDictionary *)systemInfo {
BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithDictionary:@{@"system": systemInfo}];
BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:@{@"system": systemInfo}];
device.time = [NSDate date]; // default to current time for handled errors
[device appendRuntimeInfo:self.extraRuntimeInfo];
device.orientation = _lastOrientation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,25 +371,34 @@ + (NSDictionary *)systemInfo {
#ifdef __clang_version__
sysInfo[@BSG_KSSystemField_ClangVersion] = @__clang_version__;
#endif
#if BSG_HAS_UIDEVICE
sysInfo[@BSG_KSSystemField_SystemName] = [UIDEVICE currentDevice].systemName;
sysInfo[@BSG_KSSystemField_SystemVersion] = [UIDEVICE currentDevice].systemVersion;
#else
#if TARGET_OS_IOS
// Note: This does not match UIDevice.currentDevice.systemName for versions
// prior to (and some versions of) iOS 9 where the systemName was reported
// as "iPhone OS". UIDevice gets its data from MobileGestalt which is a
// private API. /System/Library/CoreServices/SystemVersion.plist contains
// the information we need but will contain the macOS information when
// running on the Simulator.
sysInfo[@BSG_KSSystemField_SystemName] = @"iOS";
#elif TARGET_OS_OSX
sysInfo[@BSG_KSSystemField_SystemName] = @"Mac OS";
#elif TARGET_OS_TV
sysInfo[@BSG_KSSystemField_SystemName] = @"tvOS";
#endif
NSOperatingSystemVersion version =
[NSProcessInfo processInfo].operatingSystemVersion;
NSString *systemVersion;
if (version.patchVersion == 0) {
systemVersion =
[NSString stringWithFormat:@"%ld.%ld", version.majorVersion,
version.minorVersion];
[NSString stringWithFormat:@"%ld.%ld",
(long)version.majorVersion, (long)version.minorVersion];
} else {
systemVersion = [NSString
stringWithFormat:@"%ld.%ld.%ld", version.majorVersion,
version.minorVersion, version.patchVersion];
systemVersion =
[NSString stringWithFormat:@"%ld.%ld.%ld",
(long)version.majorVersion, (long)version.minorVersion,
(long)version.patchVersion];
}
sysInfo[@BSG_KSSystemField_SystemVersion] = systemVersion;
#endif

if ([self isSimulatorBuild]) {
NSString *model = [NSProcessInfo processInfo]
.environment[BSGKeySimulatorModelId];
Expand Down Expand Up @@ -429,11 +438,11 @@ + (NSDictionary *)systemInfo {
sysInfo[@BSG_KSSystemField_DeviceAppHash] = [self deviceAndAppHash];
sysInfo[@BSG_KSSystemField_BuildType] = [BSG_KSSystemInfo buildType];

NSDictionary *memory = @{
@BSG_KSSystemField_Size: [self int64Sysctl:@"hw.memsize"],
@BSG_KSCrashField_Usable: @(bsg_ksmachusableMemory())
sysInfo[@(BSG_KSSystemField_Memory)] = @{
@(BSG_KSCrashField_Free): @(bsg_ksmachfreeMemory()),
@(BSG_KSCrashField_Usable): @(bsg_ksmachusableMemory()),
@(BSG_KSSystemField_Size): [self int64Sysctl:@"hw.memsize"]
};
sysInfo[@BSG_KSSystemField_Memory] = memory;

NSDictionary *statsInfo = [[BSG_KSCrash sharedInstance] captureAppStats];
sysInfo[@BSG_KSCrashField_AppStats] = statsInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <mach/mach_time.h>
#include <sys/sysctl.h>

#if __has_include(<os/proc.h>) && TARGET_OS_IPHONE
#if __has_include(<os/proc.h>) && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST
#include <os/proc.h>
#endif

Expand Down Expand Up @@ -71,7 +71,7 @@ static pthread_t bsg_g_topThread;
static size_t (* get_available_memory)(void);

static void bsg_ksmachfreeMemory_init(void) {
#if __has_include(<os/proc.h>) && TARGET_OS_IPHONE
#if __has_include(<os/proc.h>) && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST
if (__builtin_available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)) {
// Only use `os_proc_available_memory` if it appears to be working.
// 0 is returned if the calling process is not an app or is running
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN

@interface BugsnagDevice ()

+ (instancetype)deviceWithDictionary:(NSDictionary *)event;
+ (instancetype)deviceWithKSCrashReport:(NSDictionary *)event;

+ (instancetype)deserializeFromJson:(NSDictionary *)json;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ + (BugsnagDevice *)deserializeFromJson:(NSDictionary *)json {
return device;
}

+ (BugsnagDevice *)deviceWithDictionary:(NSDictionary *)event {
+ (BugsnagDevice *)deviceWithKSCrashReport:(NSDictionary *)event {
BugsnagDevice *device = [BugsnagDevice new];
[self populateFields:device dictionary:event];
return device;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN

+ (instancetype)deviceFromJson:(NSDictionary *)json;

+ (instancetype)deviceWithDictionary:(NSDictionary *)event;
+ (instancetype)deviceWithKSCrashReport:(NSDictionary *)event;

+ (instancetype)deviceWithOomData:(NSDictionary *)data;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ + (BugsnagDeviceWithState *)deviceWithOomData:(NSDictionary *)data {
return device;
}

+ (BugsnagDeviceWithState *)deviceWithDictionary:(NSDictionary *)event {
+ (BugsnagDeviceWithState *)deviceWithKSCrashReport:(NSDictionary *)event {
BugsnagDeviceWithState *device = [BugsnagDeviceWithState new];
[self populateFields:device dictionary:event];
device.orientation = [event valueForKeyPath:@"user.state.deviceState.orientation"];
device.freeMemory = [event valueForKeyPath:@"system.memory.free"] ?: [event valueForKeyPath:@"system.memory.usable"];
device.freeMemory = [event valueForKeyPath:@"system.memory.free"];
device.freeDisk = BSGDeviceFreeSpace(NSCachesDirectory);

NSString *val = [event valueForKeyPath:@"report.timestamp"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ - (instancetype)initWithKSCrashData:(NSDictionary *)event {
}
}
NSString *deviceAppHash = [event valueForKeyPath:@"system.device_app_hash"];
BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithDictionary:event];
BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:event];
BugsnagUser *user = [self parseUser:event deviceAppHash:deviceAppHash deviceId:device.id];
BugsnagConfiguration *config = [[BugsnagConfiguration alloc] initWithDictionaryRepresentation:[event valueForKeyPath:@"user.config"]];
BugsnagAppWithState *app = [BugsnagAppWithState appWithDictionary:event config:config codeBundleId:self.codeBundleId];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (instancetype)init {
#else
self.name = @"Bugsnag Objective-C";
#endif
self.version = @"6.7.0";
self.version = @"6.7.1";
self.url = @"https://github.com/bugsnag/bugsnag-cocoa";
self.dependencies = [NSMutableArray new];
}
Expand Down
13 changes: 13 additions & 0 deletions packages/react-native/ios/vendor/bugsnag-cocoa/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Changelog
=========

## 6.7.1 (2021-03-10)

### Bug fixes

* Fix `os_proc_available_memory` runtime link error on Mac Catalyst.
[#1025](https://github.com/bugsnag/bugsnag-cocoa/pull/1025)

* Fix missing `osName` and `osVersion` for errors reported from app extensions that do not link against UIKit.
[#1022](https://github.com/bugsnag/bugsnag-cocoa/pull/1022)

* Fix incorrect `freeMemory` for errors reported via `notify()`
[#1021](https://github.com/bugsnag/bugsnag-cocoa/pull/1021)

## 6.7.0 (2021-03-03)

### Enhancements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.7.0</string>
<string>6.7.1</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ios/vendor/bugsnag-cocoa/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.7.0
6.7.1

0 comments on commit e4dade7

Please sign in to comment.