Skip to content

Commit

Permalink
feat: migrate osBuild to device.runtimeVersions field
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Apr 23, 2019
1 parent 2292f0f commit 39685c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Source/BugsnagKSCrashSysInfoParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@
BSGDictSetSafeObject(deviceState, report[@"machine"], @"model");
BSGDictSetSafeObject(deviceState, report[@"system_name"], @"osName");
BSGDictSetSafeObject(deviceState, report[@"system_version"], @"osVersion");
BSGDictSetSafeObject(deviceState, report[@"os_version"], @"osBuild");

NSString *osVersion = report[@"os_version"];

if (osVersion != nil) {
BSGDictSetSafeObject(deviceState, @{@"osBuild": osVersion}, @"runtimeVersions");
}

BSGDictSetSafeObject(deviceState, @(PLATFORM_WORD_SIZE), @"wordSize");
BSGDictSetSafeObject(deviceState, @"Apple", @"manufacturer");
BSGDictSetSafeObject(deviceState, report[@"jailbroken"], @"jailbroken");
Expand Down
2 changes: 1 addition & 1 deletion Tests/BugsnagSinkTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ - (void)testEventDevice {
XCTAssertEqualObjects(device[@"modelNumber"], @"MacBookPro11,3");
XCTAssertEqualObjects(device[@"osName"], @"iPhone OS");
XCTAssertEqualObjects(device[@"osVersion"], @"8.1");
XCTAssertEqualObjects(device[@"osBuild"], @"14B25");
XCTAssertEqualObjects(device[@"runtimeVersions"][@"osBuild"], @"14B25");
XCTAssertEqualObjects(device[@"totalMemory"], @15065522176);
XCTAssertNotNil(device[@"freeDisk"]);
XCTAssertEqualObjects(device[@"timezone"], @"PST");
Expand Down

0 comments on commit 39685c1

Please sign in to comment.