Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v6.27.3 #1610

Merged
merged 80 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
59bde82
Allow Maze Runner commands to finish
kstenerud Aug 7, 2023
41a3f6d
Resume polling after failure conditions
twometresteve Aug 8, 2023
bd805c6
Update test fixtures just once
twometresteve Aug 9, 2023
dde8262
Attempted fix of flaky test scenarios
twometresteve Aug 9, 2023
88ffb4a
Relax condition that the app is not running
twometresteve Aug 9, 2023
b43d4ec
Further flaky test fix attempt
twometresteve Aug 10, 2023
cd04ead
Correction
twometresteve Aug 11, 2023
8d13064
Skip flaky step
twometresteve Aug 11, 2023
1ca6c9d
Merge pull request #1573 from bugsnag/tms/command-polling
twometresteve Aug 14, 2023
2e78a15
Don't use syscall on osx
kstenerud Aug 31, 2023
7f1198d
Merge pull request #1577 from bugsnag/PLAT-10752-no-syscall-on-osx
kstenerud Sep 6, 2023
8f9f484
Remove NXArchInfo because it's deprecated
kstenerud Sep 27, 2023
3b4e5e8
Merge pull request #1584 from bugsnag/PLAT-10973-remove-nxarchinfo
kstenerud Sep 27, 2023
f7a8525
Rationalise BitBar CI concurrency group
twometresteve Sep 29, 2023
c8dd842
Merge pull request #1586 from bugsnag/tms/bitbar-group
twometresteve Sep 29, 2023
b9a45f4
add BUILDKITE_JOB_ID to docker-compose
Oct 19, 2023
ccd790d
Merge pull request #1592 from bugsnag/je/plat-11104-add-buildkite-job-id
joshedney Oct 20, 2023
b955e3f
Temporarily disable ios 11 barebones tests
kstenerud Nov 1, 2023
4e1f95f
Temporarily disable ios 16 app hang tests
kstenerud Nov 1, 2023
ce12a7d
Correct format specifier for logged messages
twometresteve Oct 25, 2023
df8c497
Temporarily disable ios 11 E2E tests batches 1 and 2
kstenerud Nov 1, 2023
c1a80ab
Merge pull request #1598 from bugsnag/karl-fix-pipeline
kstenerud Nov 1, 2023
3c0e211
Skip app hang scenarios on all platforms and iOS versions
twometresteve Nov 2, 2023
9f53e7b
Remove random ordering
twometresteve Nov 2, 2023
957aad4
Harmonize logging
kstenerud Nov 2, 2023
2cbea29
Merge pull request #1600 from bugsnag/tms/skip-app-hangs
twometresteve Nov 2, 2023
d81d4f9
Merge branch 'next' into karl-mazerunner-logging
twometresteve Nov 2, 2023
802ffb1
Tune down detail logs to debug level
twometresteve Nov 2, 2023
c2fd0c1
dynamically select watchos target
Nov 3, 2023
e7843e7
Add logDebug
twometresteve Nov 3, 2023
5b0409b
Merge pull request #1602 from bugsnag/je/fix-watchos-xcode-builds
twometresteve Nov 3, 2023
eb6bb90
Merge pull request #1601 from bugsnag/karl-mazerunner-logging
twometresteve Nov 3, 2023
800ce32
Skip app_hangs.feature on BitBar (Appium 2)
twometresteve Nov 6, 2023
7a42915
Run app hang tests on Appium 1 (BrowserStack)
twometresteve Nov 6, 2023
7e2d056
Fix handling of null fields in the user
kstenerud Oct 23, 2023
6762e10
Added iOS 17 testing to the pipeline
Oct 11, 2023
aab4504
Updated pipeline
Oct 11, 2023
6247d94
Updated pipeline
Oct 11, 2023
aa0cf2c
Bumped deployment target for the network request plugin
Oct 11, 2023
241ae3a
Updated Makefile for iOS 17 support
Oct 11, 2023
1784ac4
Fixed Unit tests for iOS 17
Oct 16, 2023
b8f5268
Fixed unit tests on macOS
Oct 16, 2023
7ca774f
Moved iOS 17 E2E tests to browserstack
Oct 16, 2023
eaf7cf7
Fixes to pipeline.yml
Oct 16, 2023
ad4f910
Fixed indentation in pipeline.yml
Oct 16, 2023
9e208c8
adjust bs options for ios 17
Oct 17, 2023
2e7a510
adjust bs options for ios 17
Oct 17, 2023
14ca84f
update ios 17 batch 2 settings
Oct 17, 2023
43cd2ec
ios 17 testing
Oct 17, 2023
07686b6
Added a fix for barebone tests
Oct 17, 2023
b0a18ba
macos still uses NSArray, not array.
kstenerud Oct 17, 2023
9dc78a5
set xcode version to 14.3
Oct 20, 2023
6c72cd9
Use Appium 1.21.0, not 1.22.0 to prevent app hang scenario problems
twometresteve Nov 7, 2023
9eb3bf6
Use exceptions whose messages we control in tests
kstenerud Nov 7, 2023
330d39e
Merge pull request #1587 from bugsnag/robert/plat-10987_ios_17_testing
kstenerud Nov 7, 2023
d7edee0
Merge pull request #1599 from bugsnag/PLAT-11007-null-user-components-2
kstenerud Nov 8, 2023
89cc9fb
Merge pull request #1604 from bugsnag/tms/app-hangs-bs
twometresteve Nov 8, 2023
0430c79
build: pushing watchOS unit tests to later Xcode version
Oct 24, 2023
1875972
move watchos tests to xcode 14
Oct 25, 2023
78c8d4f
use watchsimulator9.0 for the ci tests
Oct 25, 2023
f0fb054
increase timeout for watchos steps
Oct 25, 2023
190d4e7
increase timeout for watchos steps
Oct 25, 2023
11cfa37
Also run the test setup on watchos.
kstenerud Nov 7, 2023
2769b60
Make sure the mach images list is initialized before use.
kstenerud Nov 9, 2023
0218b12
Merge pull request #1605 from bugsnag/karl-watchos-testing-fixes
kstenerud Nov 9, 2023
1db81a4
Fixes issue when using Bugsnag on a WatchOS app
gpambrozio Sep 14, 2023
2144572
WKApplication is only available on WatchOS 7+
kstenerud Oct 12, 2023
bbe5cfc
Override the main bundle in watchos unit tests to add an NSExtension …
kstenerud Nov 9, 2023
d2c982b
Merge pull request #1588 from bugsnag/gpambrozio/watchapp-fix
kstenerud Nov 10, 2023
6840c9e
Check the app's bundle version as an extra precaution against false n…
kstenerud Nov 1, 2023
483715d
Merge pull request #1597 from bugsnag/PLAT-11112-check-app-version
kstenerud Nov 13, 2023
795dcab
Add release trigger for downstream targets to update
Cawllec Oct 26, 2023
45c6079
Rebase and fix broken yaml
Cawllec Nov 13, 2023
81e4ad9
Consistently fail-fast e2e test scenarios
twometresteve Nov 13, 2023
d61c248
Merge pull request #1609 from bugsnag/tms/fail-fast
twometresteve Nov 13, 2023
97c2aa0
update include statements
neil477 Nov 3, 2023
9b847ef
Move all include directives outside of the extern C sections
kstenerud Nov 13, 2023
a178389
Merge pull request #1608 from bugsnag/karl-reorg-headers
tomlongridge Nov 15, 2023
9629c7c
Merge pull request #1596 from bugsnag/testing/dep-updater-trigger
tomlongridge Nov 15, 2023
2405f9d
Release v6.27.3
kstenerud Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 158 additions & 42 deletions .buildkite/pipeline.full.yml

Large diffs are not rendered by default.

183 changes: 143 additions & 40 deletions .buildkite/pipeline.yml

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions .github/workflows/downstream_updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: downstream-updates

on:
release:
types: [released]
workflow_dispatch:
inputs:
target_version:
description: 'Version of the submodule to update downstream repos to'
required: true
type: string

jobs:
update-dependencies:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.target_version || github.event.release.tag_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
downstream_repo: ['bugsnag/bugsnag-unity']
steps:
- name: Install libcurl4-openssl-dev and net-tools
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev net-tools

- run: >
curl -X POST https://api.github.com/repos/${{ matrix.downstream_repo }}/dispatches
-H 'Content-Type: application/json'
-H "Authorization: Bearer $GITHUB_TOKEN"
-d '{"event_type":"update-dependency","client_payload": {"target_submodule":"bugsnag-cocoa", "target_version": "$RELEASE_VERSION"}}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ Package.resolved
/docs/
/infer-out
/oclint.json
bb.ready
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ author_url: "https://www.bugsnag.com"
author: "Bugsnag Inc"
clean: false # avoid deleting docs/.git
framework_root: "Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.27.2/Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.27.3/Bugsnag"
github_url: "https://github.com/bugsnag/bugsnag-cocoa"
hide_documentation_coverage: true
module: "Bugsnag"
module_version: "6.27.2"
module_version: "6.27.3"
objc: true
output: "docs"
readme: "README.md"
Expand Down
4 changes: 2 additions & 2 deletions Bugsnag.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bugsnag",
"version": "6.27.2",
"version": "6.27.3",
"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.27.2"
"tag": "v6.27.3"
},
"ios": {
"frameworks": [
Expand Down
28 changes: 26 additions & 2 deletions Bugsnag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,14 @@
01FF490728BF8B7B001F817B /* BugsnagInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 01FF490528BF8B7B001F817B /* BugsnagInternals.h */; };
01FF490828BF8B7B001F817B /* BugsnagInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 01FF490528BF8B7B001F817B /* BugsnagInternals.h */; };
01FF490928BF8B7B001F817B /* BugsnagInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 01FF490528BF8B7B001F817B /* BugsnagInternals.h */; };
093EB6602AFE447E006EB7E3 /* Swizzle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB65F2AFE447E006EB7E3 /* Swizzle.mm */; };
093EB6612AFE447E006EB7E3 /* Swizzle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB65F2AFE447E006EB7E3 /* Swizzle.mm */; };
093EB6622AFE447E006EB7E3 /* Swizzle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB65F2AFE447E006EB7E3 /* Swizzle.mm */; };
093EB6632AFE447E006EB7E3 /* Swizzle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB65F2AFE447E006EB7E3 /* Swizzle.mm */; };
093EB6662AFE4580006EB7E3 /* BSGTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB6652AFE4580006EB7E3 /* BSGTestCase.mm */; };
093EB6672AFE4580006EB7E3 /* BSGTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB6652AFE4580006EB7E3 /* BSGTestCase.mm */; };
093EB6682AFE4580006EB7E3 /* BSGTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB6652AFE4580006EB7E3 /* BSGTestCase.mm */; };
093EB6692AFE4580006EB7E3 /* BSGTestCase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 093EB6652AFE4580006EB7E3 /* BSGTestCase.mm */; };
3A700A9424A63ABC0068CD1B /* BugsnagThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A700A8024A63A8E0068CD1B /* BugsnagThread.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A700A9524A63AC50068CD1B /* BugsnagSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A700A8124A63A8E0068CD1B /* BugsnagSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
3A700A9624A63AC60068CD1B /* BugsnagStackframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A700A8224A63A8E0068CD1B /* BugsnagStackframe.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1539,6 +1547,10 @@
01E8765D256684E700F4B70A /* URLSessionMock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = URLSessionMock.m; sourceTree = "<group>"; };
01F9FCB528929336005EDD8C /* BSGSerializationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSGSerializationTests.m; sourceTree = "<group>"; };
01FF490528BF8B7B001F817B /* BugsnagInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagInternals.h; sourceTree = "<group>"; };
093EB65E2AFE447E006EB7E3 /* Swizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Swizzle.h; sourceTree = "<group>"; };
093EB65F2AFE447E006EB7E3 /* Swizzle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Swizzle.mm; sourceTree = "<group>"; };
093EB6642AFE4580006EB7E3 /* BSGTestCase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BSGTestCase.h; sourceTree = "<group>"; };
093EB6652AFE4580006EB7E3 /* BSGTestCase.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BSGTestCase.mm; sourceTree = "<group>"; };
3A700A8024A63A8E0068CD1B /* BugsnagThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagThread.h; sourceTree = "<group>"; };
3A700A8124A63A8E0068CD1B /* BugsnagSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagSession.h; sourceTree = "<group>"; };
3A700A8224A63A8E0068CD1B /* BugsnagStackframe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BugsnagStackframe.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1934,8 +1946,6 @@
00AD1C7F24869B0E00A27979 /* BugsnagTests */ = {
isa = PBXGroup;
children = (
CBEC893E2A4ACD230088A3CE /* FileBasedTest.h */,
CBEC893F2A4ACD230088A3CE /* FileBasedTest.m */,
019480D32625F3EB00E833ED /* BSGAppKitTests.m */,
008966BD2486D43500DC48C2 /* BSGClientObserverTests.m */,
00896A3F2486DBDD00DC48C2 /* BSGConfigurationBuilderTests.m */,
Expand All @@ -1953,6 +1963,8 @@
01F9FCB528929336005EDD8C /* BSGSerializationTests.m */,
CB6419AA25A73E8C00613D25 /* BSGStorageMigratorV0V1Tests.m */,
017DCF9A287422BB000ECB22 /* BSGTelemetryTests.m */,
093EB6642AFE4580006EB7E3 /* BSGTestCase.h */,
093EB6652AFE4580006EB7E3 /* BSGTestCase.mm */,
01DE903B26CEAF9E00455213 /* BSGUtilsTests.m */,
CB9103632502320A00E9D1E2 /* BugsnagApiClientTest.m */,
E701FA9E2490EF4A008D842F /* BugsnagApiValidationTest.m */,
Expand Down Expand Up @@ -1995,9 +2007,13 @@
E701FAAE2490EFE8008D842F /* ConfigurationApiValidationTest.m */,
01BDB21425DEC02900A91FAF /* Data */,
E701FAAA2490EFD9008D842F /* EventApiValidationTest.m */,
CBEC893E2A4ACD230088A3CE /* FileBasedTest.h */,
CBEC893F2A4ACD230088A3CE /* FileBasedTest.m */,
00E636C324878FFC006CBF1A /* Info.plist */,
01B14C55251CE55F00118748 /* report-react-native-promise-rejection.json */,
008966B72486D43500DC48C2 /* report.json */,
093EB65E2AFE447E006EB7E3 /* Swizzle.h */,
093EB65F2AFE447E006EB7E3 /* Swizzle.mm */,
004E35392487B375007FBAE4 /* Tests-Bridging-Header.h */,
CBA22499251E429C00B87416 /* TestSupport.h */,
CBA2249A251E429C00B87416 /* TestSupport.m */,
Expand Down Expand Up @@ -3149,6 +3165,7 @@
0089679F2486D43700DC48C2 /* KSCrashSentry_Tests.m in Sources */,
008967872486D43700DC48C2 /* KSCrashSentry_NSException_Tests.m in Sources */,
0089679C2486D43700DC48C2 /* KSFileUtils_Tests.m in Sources */,
093EB6602AFE447E006EB7E3 /* Swizzle.mm in Sources */,
008966EE2486D43700DC48C2 /* BugsnagClientPayloadInfoTest.m in Sources */,
010F80C228645B4200D6569E /* BSGDefinesTests.m in Sources */,
01BDB1F525DEBFB200A91FAF /* BSGEventUploadKSCrashReportOperationTests.m in Sources */,
Expand All @@ -3168,6 +3185,7 @@
008967152486D43700DC48C2 /* BugsnagCollectionsTests.m in Sources */,
01E8765E256684E700F4B70A /* URLSessionMock.m in Sources */,
008967AB2486D43700DC48C2 /* BSG_KSMachTests.m in Sources */,
093EB6662AFE4580006EB7E3 /* BSGTestCase.mm in Sources */,
0089672A2486D43700DC48C2 /* BugsnagStacktraceTest.m in Sources */,
01847DAC26441A5E00ADA4C7 /* BSGInternalErrorReporterTests.m in Sources */,
0163BF5925823D8D008DC28B /* BSGNotificationBreadcrumbsTests.m in Sources */,
Expand Down Expand Up @@ -3315,6 +3333,7 @@
008967822486D43700DC48C2 /* KSSystemInfo_Tests.m in Sources */,
008967612486D43700DC48C2 /* BugsnagBreadcrumbsTest.m in Sources */,
01DE903D26CEAF9E00455213 /* BSGUtilsTests.m in Sources */,
093EB6672AFE4580006EB7E3 /* BSGTestCase.mm in Sources */,
CB156242270707740097334C /* KSCrashNames_Test.m in Sources */,
008967012486D43700DC48C2 /* BugsnagEventPersistLoadTest.m in Sources */,
0089671C2486D43700DC48C2 /* BugsnagSessionTest.m in Sources */,
Expand All @@ -3341,6 +3360,7 @@
004E353B2487B3B3007FBAE4 /* BugsnagSwiftPublicAPITests.swift in Sources */,
0089677C2486D43700DC48C2 /* RFC3339DateTool_Tests.m in Sources */,
CBEC89412A4ACD240088A3CE /* FileBasedTest.m in Sources */,
093EB6612AFE447E006EB7E3 /* Swizzle.mm in Sources */,
01A2958728B667C2005FCC8C /* BSGNetworkBreadcrumbTests.m in Sources */,
008967552486D43700DC48C2 /* BugsnagOnCrashTest.m in Sources */,
008967A02486D43700DC48C2 /* KSCrashSentry_Tests.m in Sources */,
Expand Down Expand Up @@ -3481,6 +3501,7 @@
01B6BB7E25D5777F00FC4DE6 /* BugsnagSwiftPublicAPITests.swift in Sources */,
0089677A2486D43700DC48C2 /* BSG_KSMachHeadersTests.m in Sources */,
0089672C2486D43700DC48C2 /* BugsnagStacktraceTest.m in Sources */,
093EB6682AFE4580006EB7E3 /* BSGTestCase.mm in Sources */,
008966F32486D43700DC48C2 /* BugsnagMetadataRedactionTest.m in Sources */,
008967382486D43700DC48C2 /* BugsnagMetadataTests.m in Sources */,
008967832486D43700DC48C2 /* KSSystemInfo_Tests.m in Sources */,
Expand Down Expand Up @@ -3514,6 +3535,7 @@
008967442486D43700DC48C2 /* BugsnagSessionTrackerStopTest.m in Sources */,
CB26E9BC28350E0C005A1865 /* UISceneStub.m in Sources */,
008967982486D43700DC48C2 /* KSCrashState_Tests.m in Sources */,
093EB6622AFE447E006EB7E3 /* Swizzle.mm in Sources */,
008967772486D43700DC48C2 /* XCTestCase+KSCrash.m in Sources */,
01A2958828B667C2005FCC8C /* BSGNetworkBreadcrumbTests.m in Sources */,
CBEC89422A4ACD240088A3CE /* FileBasedTest.m in Sources */,
Expand Down Expand Up @@ -3748,7 +3770,9 @@
CB28F0B828294DE1003AB200 /* BSGConfigurationBuilderTests.m in Sources */,
CB28F0DB282A4BA6003AB200 /* BugsnagMetadataTests.m in Sources */,
CB28F0B028294D4F003AB200 /* KSFileUtils_Tests.m in Sources */,
093EB6632AFE447E006EB7E3 /* Swizzle.mm in Sources */,
CB28F0DC282A4BEE003AB200 /* BugsnagSessionTrackerTest.m in Sources */,
093EB6692AFE4580006EB7E3 /* BSGTestCase.mm in Sources */,
CB28F0B728294DE1003AB200 /* BSGFeatureFlagStoreTests.m in Sources */,
010F80C528645B4200D6569E /* BSGDefinesTests.m in Sources */,
CB28F0A028294D44003AB200 /* BSG_KSFileTests.m in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions Bugsnag/BugsnagInternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ typedef void (^ BSGClientObserver)(BSGClientObserverEvent event, _Nullable id va

- (NSDictionary *)toJson;

- (NSDictionary *)toJsonWithNSNulls;

@end

#pragma mark -
Expand Down
2 changes: 1 addition & 1 deletion Bugsnag/Client/BugsnagClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ - (BugsnagUser *)user {
- (void)setUser:(NSString *)userId withEmail:(NSString *)email andName:(NSString *)name {
@synchronized (self.configuration) {
[self.configuration setUser:userId withEmail:email andName:name];
[self.state addMetadata:[self.configuration.user toJson] toSection:BSGKeyUser];
[self.state addMetadata:[self.configuration.user toJsonWithNSNulls] toSection:BSGKeyUser];
if (self.observer) {
self.observer(BSGClientObserverUpdateUser, self.user);
}
Expand Down
2 changes: 1 addition & 1 deletion Bugsnag/Helpers/BSGDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define BSG_HAVE_REACHABILITY_WWAN ( TARGET_OS_IOS || TARGET_OS_TV )
#define BSG_HAVE_SIGNAL (TARGET_OS_OSX || TARGET_OS_IOS || TARGET_OS_TV )
#define BSG_HAVE_SIGALTSTACK (TARGET_OS_OSX || TARGET_OS_IOS )
#define BSG_HAVE_SYSCALL (TARGET_OS_OSX || TARGET_OS_IOS || TARGET_OS_TV )
#define BSG_HAVE_SYSCALL (TARGET_OS_IOS || TARGET_OS_TV )
#define BSG_HAVE_UIDEVICE __has_include(<UIKit/UIDevice.h>)
#define BSG_HAVE_WINDOW (TARGET_OS_OSX || TARGET_OS_IOS || TARGET_OS_TV )

Expand Down
3 changes: 2 additions & 1 deletion Bugsnag/Helpers/BSGRunContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// During development this is not strictly necessary since last run's data will
// not be loaded if the struct's size has changed.
//
#define BSGRUNCONTEXT_VERSION 4
#define BSGRUNCONTEXT_VERSION 5

struct BSGRunContext {
long structVersion;
Expand Down Expand Up @@ -50,6 +50,7 @@ struct BSGRunContext {
unsigned long long memoryAvailable;
unsigned long long memoryFootprint;
unsigned long long memoryLimit;
char bundleVersion[32]; // Won't actually get this long but just to be sure.
};

/// Information about the current run of the app / process.
Expand Down
51 changes: 41 additions & 10 deletions Bugsnag/Helpers/BSGRunContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,21 @@ static void InitRunContext(void) {
}

bsg_runContext->bootTime = GetBootTime();


// Make sure the images list is populated.
bsg_mach_headers_initialize();

BSG_Mach_Header_Info *image = bsg_mach_headers_get_main_image();
if (image && image->uuid) {
uuid_copy(bsg_runContext->machoUUID, image->uuid);
}


NSString *bundleVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
const char *bundleVersionStr = (const char*)[bundleVersion cStringUsingEncoding:NSUTF8StringEncoding];
if (bundleVersionStr != nil) {
bsg_safe_strncpy(bsg_runContext->bundleVersion, bundleVersionStr, sizeof(bsg_runContext->bundleVersion));
}

if ([NSThread isMainThread]) {
bsg_runContext->isActive = GetIsActive();
} else {
Expand Down Expand Up @@ -109,8 +118,15 @@ static bool GetIsActive(void) {
#endif

#if TARGET_OS_WATCH
WKExtension *ext = [WKExtension sharedExtension];
return ext && ext.applicationState == WKApplicationStateActive;
if ([BSG_KSSystemInfo isRunningInAppExtension]) {
WKExtension *ext = [WKExtension sharedExtension];
return ext && ext.applicationState == WKApplicationStateActive;
} else if (@available(watchOS 7.0, *)) {
WKApplication *app = [WKApplication sharedApplication];
return app && app.applicationState == WKApplicationStateActive;
} else {
return true;
}
#endif
}

Expand Down Expand Up @@ -167,8 +183,15 @@ static bool GetIsForeground(void) {
#endif

#if TARGET_OS_WATCH
WKExtension *ext = [WKExtension sharedExtension];
return ext && ext.applicationState != WKApplicationStateBackground;
if ([BSG_KSSystemInfo isRunningInAppExtension]) {
WKExtension *ext = [WKExtension sharedExtension];
return ext && ext.applicationState != WKApplicationStateBackground;
} else if (@available(watchOS 7.0, *)) {
WKApplication *app = [WKApplication sharedApplication];
return app && app.applicationState == WKApplicationStateBackground;
} else {
return true;
}
#endif
}

Expand Down Expand Up @@ -470,8 +493,13 @@ bool BSGRunContextWasKilled(void) {
if (bsg_lastRunContext->bootTime != bsg_runContext->bootTime) {
return NO; // The app may have been terminated due to the reboot
}

// Ignore unexpected terminations due to the app being upgraded
if (strncmp(bsg_lastRunContext->bundleVersion,
bsg_runContext->bundleVersion,
sizeof(bsg_runContext->bundleVersion)) != 0) {
return NO;
}
if (uuid_compare(bsg_lastRunContext->machoUUID, bsg_runContext->machoUUID)) {
return NO;
}
Expand Down Expand Up @@ -499,10 +527,13 @@ bool BSGRunContextWasKilled(void) {

#define SIZEOF_STRUCT sizeof(struct BSGRunContext)

static struct BSGRunContext fallback;
struct BSGRunContext *bsg_runContext = &fallback;
static struct BSGRunContext bsg_runContext_fallback;
struct BSGRunContext *bsg_runContext = &bsg_runContext_fallback;

const struct BSGRunContext *bsg_lastRunContext;
static struct BSGRunContext bsg_lastRunContext_fallback = {
.structVersion = ~0,
};
const struct BSGRunContext *bsg_lastRunContext = &bsg_lastRunContext_fallback;

/// Opens the file and disables content protection, returning -1 on error.
static int OpenFile(NSString *_Nonnull path) {
Expand Down
6 changes: 6 additions & 0 deletions Bugsnag/Helpers/BSGUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ static inline NSString * _Nullable BSGStringFromClass(Class _Nullable cls) {
return cls ? NSStringFromClass((Class _Nonnull)cls) : nil;
}

/**
* Copy characters from src to dst, up to a maximum of length bytes (including the NUL terminator).
* Unlike strncpy, this function always ensures that dst is NUL terminated (if length > 0).
*/
void bsg_safe_strncpy(char *dst, const char *src, size_t length);

NS_ASSUME_NONNULL_END

__END_DECLS
7 changes: 7 additions & 0 deletions Bugsnag/Helpers/BSGUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

#import "BugsnagLogger.h"

void bsg_safe_strncpy(char *dst, const char *src, size_t length) {
if (length > 0) {
strncpy(dst, src, length);
dst[length-1] = 0;
}
}

char *_Nullable BSGCStringWithData(NSData *_Nullable data) {
char *buffer;
if (data.length && (buffer = calloc(1, data.length + 1))) {
Expand Down
4 changes: 2 additions & 2 deletions Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_Jailbreak.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static inline bool bsg_local_is_insert_libraries_env_var(const char* str) {
// - Use pointers for output parameters, with labels that identify them as such.
// - Beware of global consts or defines bleeding through.

#if TARGET_CPU_ARM64
#if TARGET_CPU_ARM64 && !TARGET_OS_OSX
#define BSG_HAS_CUSTOM_SYSCALL 1

// ARM64 3-parameter syscall
Expand Down Expand Up @@ -105,7 +105,7 @@ static inline bool bsg_local_is_insert_libraries_env_var(const char* str) {
} \
} while(0)

#elif TARGET_CPU_X86_64 && defined(__GCC_ASM_FLAG_OUTPUTS__)
#elif TARGET_CPU_X86_64 && defined(__GCC_ASM_FLAG_OUTPUTS__) && !TARGET_OS_OSX
#define BSG_HAS_CUSTOM_SYSCALL 1

// X86_64 3-parameter syscall
Expand Down
8 changes: 4 additions & 4 deletions Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSCrashC.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
#ifndef HDR_BSG_KSCrashC_h
#define HDR_BSG_KSCrashC_h

#ifdef __cplusplus
extern "C" {
#endif

#include "BSG_KSCrashContext.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Initialize the KSCrash system. Call this once, before any other function.
* Note: This gets called automatically by [BSG_KSCrash sharedInstance].
*/
Expand Down
Loading
Loading