From bbf533464ad11f130fcfe1a911ae26b2969085ad Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Tue, 29 Nov 2022 17:30:02 +0100 Subject: [PATCH] Merge branch 'master' into 8.0.0 --- .github/workflows/integration-tests.yml | 9 +- CHANGELOG.md | 7 + .../iOS-Swift.xcodeproj/project.pbxproj | 8 +- Samples/iOS-Swift/iOS-Swift/AppDelegate.swift | 10 +- .../iOS-Swift/Base.lproj/Main.storyboard | 62 +++++--- .../iOS-Swift/iOS-Swift/ViewController.swift | 7 + .../iOS-Swift/iOS13-Swift/AppDelegate.swift | 38 +++-- Sentry.podspec | 2 +- Sentry.xcodeproj/project.pbxproj | 4 + Sources/Configuration/Sentry.xcconfig | 2 +- Sources/Sentry/SentryCoreDataTracker.m | 5 +- Sources/Sentry/SentryCrashIntegration.m | 4 +- Sources/Sentry/SentryCrashWrapper.m | 9 +- Sources/Sentry/SentryMeta.m | 2 +- Sources/Sentry/include/SentryCrashWrapper.h | 6 +- .../SentryCrashInstallation+Private.h | 14 ++ .../Installations/SentryCrashInstallation.h | 5 + .../Installations/SentryCrashInstallation.m | 28 ++-- .../Recording/Monitors/SentryCrashMonitor.c | 8 +- .../Recording/Monitors/SentryCrashMonitor.h | 10 +- .../SentryCrashMonitor_MachException.c | 62 ++++++-- .../SentryCrashMonitor_MachException.h | 7 + Sources/SentryCrash/Recording/SentryCrash.h | 21 ++- Sources/SentryCrash/Recording/SentryCrash.m | 120 ++++++++------ Sources/SentryCrash/Recording/SentryCrashC.c | 46 +----- Sources/SentryCrash/Recording/SentryCrashC.h | 9 +- .../Recording/SentryCrashCachedData.c | 6 + .../Recording/SentryCrashCachedData.h | 1 + .../Recording/Tools/SentryCrashLogger.c | 31 ---- .../Recording/Tools/SentryCrashLogger.h | 11 -- .../Tools/SentryCrashMachineContext.c | 36 +---- .../Tools/SentryCrashMachineContext.h | 6 - Tests/SentryTests/ClearTestState.swift | 57 ++++--- .../TestNSNotificationCenterWrapper.swift | 16 +- .../CoreData/SentryCoreDataTrackerTest.swift | 28 ++++ ...SentryNetworkTrackerIntegrationTests.swift | 2 + .../SentryCrashIntegrationTests.swift | 4 +- .../SentryCrashInstallationTests.m | 146 ++++++++++++++++++ .../SentryCrash/SentryCrashLogger_Tests.m | 25 --- .../SentryThreadInspectorTests.swift | 2 +- .../SentryCrash/TestSentryCrashWrapper.h | 2 +- .../SentryCrash/TestSentryCrashWrapper.m | 6 +- 42 files changed, 548 insertions(+), 336 deletions(-) create mode 100644 Tests/SentryTests/SentryCrash/SentryCrashInstallationTests.m diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 5fddb1e91d..119878ce8c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -48,11 +48,14 @@ jobs: - name: Download and Apply Patch run: ./apply-patch.sh "${{ github.event.pull_request.head.sha }}" "${{ github.sha }}" add-sentry-to-alamofire - - name: Install Firewalk - run: brew install alamofire/alamofire/firewalk + - name: Download Firewalk + run: curl "https://github.com/Alamofire/Firewalk/releases/download/0.8.1/firewalk.zip" --output firewalk.zip -L + + - name: Unzip Firewalk + run: Unzip "firewalk.zip" - name: Start Firewalk - run: firewalk & + run: ./firewalk & - name: Validate Firewalk is running run: curl http://localhost:8080/ diff --git a/CHANGELOG.md b/CHANGELOG.md index f50ef5c550..cf6a8ddf30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,13 @@ This version adds a dependency on Swift. - Rename `SentryOptions.enablePreWarmedAppStartTracking` to `enablePreWarmedAppStartTracing` - Rename `SentryOptions.enableFileIOTracking` to `enableFileIOTracing` - Rename `SentryOptions.enableCoreDataTracking` to `enableCoreDataTracing` + +## 7.31.3 + +### Fixes + +- Reporting crashes when restarting the SDK (#2440) +- Core data span status with error (#2439) ## 7.31.2 diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj index 1e717cffe9..c1c94c626d 100644 --- a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj +++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj @@ -1111,7 +1111,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.31.2; + MARKETING_VERSION = 7.31.3; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift"; @@ -1140,7 +1140,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.31.2; + MARKETING_VERSION = 7.31.3; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.sentry.sample.iOS-Swift"; @@ -1785,7 +1785,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.31.2; + MARKETING_VERSION = 7.31.3; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift.Clip"; @@ -1820,7 +1820,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 7.31.2; + MARKETING_VERSION = 7.31.3; PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.sentry.sample.iOS-Swift.Clip"; diff --git a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift index 3d273396dc..eb0d35b200 100644 --- a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift +++ b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift @@ -7,9 +7,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? static let defaultDSN = "https://6cc9bae94def43cab8444a99e0031c28@o447951.ingest.sentry.io/5428557" - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - + + static func startSentry() { // For testing purposes, we want to be able to change the DSN and store it to disk. In a real app, you shouldn't need this behavior. let dsn = DSNStorage.shared.getDSN() ?? AppDelegate.defaultDSN DSNStorage.shared.saveDSN(dsn: dsn) @@ -45,6 +44,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let httpStatusCodeRange = HttpStatusCodeRange(min: 400, max: 599) options.failedRequestStatusCodes = [ httpStatusCodeRange ] } + } + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + AppDelegate.startSentry() if #available(iOS 14.0, *) { metricKit.receiveReports() diff --git a/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard b/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard index 0ed14a09ab..029585c65a 100644 --- a/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard +++ b/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -18,13 +18,13 @@ - + - + - + + + - +