From 92b7ed2884bb6303afe7b33224631e3b3d733a66 Mon Sep 17 00:00:00 2001 From: Kevin Renskers Date: Mon, 12 Dec 2022 14:19:17 +0100 Subject: [PATCH 1/2] Rename the watchdog option --- CHANGELOG.md | 2 +- Sources/Sentry/Public/SentryOptions.h | 2 +- Sources/Sentry/SentryBaseIntegration.m | 6 +++--- Sources/Sentry/SentryOptions.m | 2 +- Sources/Sentry/SentryWatchdogTerminationsLogic.m | 2 +- .../Sentry/SentryWatchdogTerminationsTrackingIntegration.m | 2 +- Sources/Sentry/include/SentryBaseIntegration.h | 2 +- .../AppStartTracking/SentryAppStartTrackerTests.swift | 2 +- .../SentryCrash/SentryCrashIntegrationTests.swift | 2 +- .../SentryWatchdogTerminationsIntegrationTests.swift | 2 +- Tests/SentryTests/SentryOptionsTest.m | 2 +- scripts/set-device-tests-environment.patch | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce74dbc580b..596b826ff26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,7 +52,7 @@ This version adds a dependency on Swift. - Rename `SentryOptions.enableCoreDataTracking` to `enableCoreDataTracing` - SentrySDK.close calls flush, which is a blocking call (#2453) - Bump minimum Xcode version to 13 (#2483) -- Rename `SentryOptions.enableOutOfMemoryTracking` to `SentryOptions.enableWatchdogTerminationsTracking` (#2499) +- Rename `SentryOptions.enableOutOfMemoryTracking` to `SentryOptions.enableWatchdogTerminationTracking` (#2499) ## 8.0.0-beta.4 diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index ff0c9f76c00..3a005a16814 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -138,7 +138,7 @@ NS_SWIFT_NAME(Options) /** * Whether to enable Watchdog Terminations tracking or not. Default is YES. */ -@property (nonatomic, assign) BOOL enableWatchdogTerminationsTracking; +@property (nonatomic, assign) BOOL enableWatchdogTerminationTracking; /** * The interval to end a session if the App goes to the background. diff --git a/Sources/Sentry/SentryBaseIntegration.m b/Sources/Sentry/SentryBaseIntegration.m index e42b4f1263d..febc180f666 100644 --- a/Sources/Sentry/SentryBaseIntegration.m +++ b/Sources/Sentry/SentryBaseIntegration.m @@ -43,9 +43,9 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options return NO; } - if ((integrationOptions & kIntegrationOptionEnableWatchdogTerminationsTracking) - && !options.enableWatchdogTerminationsTracking) { - [self logWithOptionName:@"enableWatchdogTerminationsTracking"]; + if ((integrationOptions & kIntegrationOptionEnableWatchdogTerminationTracking) + && !options.enableWatchdogTerminationTracking) { + [self logWithOptionName:@"enableWatchdogTerminationTracking"]; return NO; } diff --git a/Sources/Sentry/SentryOptions.m b/Sources/Sentry/SentryOptions.m index 1738f5cee8d..9dddabf4baa 100644 --- a/Sources/Sentry/SentryOptions.m +++ b/Sources/Sentry/SentryOptions.m @@ -65,7 +65,7 @@ - (instancetype)init _defaultSampleRate = @1; self.sampleRate = _defaultSampleRate; self.enableAutoSessionTracking = YES; - self.enableWatchdogTerminationsTracking = YES; + self.enableWatchdogTerminationTracking = YES; self.sessionTrackingIntervalMillis = [@30000 unsignedIntValue]; self.attachStacktrace = YES; self.stitchAsyncCode = NO; diff --git a/Sources/Sentry/SentryWatchdogTerminationsLogic.m b/Sources/Sentry/SentryWatchdogTerminationsLogic.m index ac3e8e2d717..ca4952fec56 100644 --- a/Sources/Sentry/SentryWatchdogTerminationsLogic.m +++ b/Sources/Sentry/SentryWatchdogTerminationsLogic.m @@ -35,7 +35,7 @@ - (instancetype)initWithOptions:(SentryOptions *)options - (BOOL)isWatchdogTermination { - if (!self.options.enableWatchdogTerminationsTracking) { + if (!self.options.enableWatchdogTerminationTracking) { return NO; } diff --git a/Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m b/Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m index 7b4d99e8f97..da4724972c8 100644 --- a/Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m +++ b/Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m @@ -89,7 +89,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options - (SentryIntegrationOption)integrationOptions { - return kIntegrationOptionEnableWatchdogTerminationsTracking; + return kIntegrationOptionEnableWatchdogTerminationTracking; } - (void)uninstall diff --git a/Sources/Sentry/include/SentryBaseIntegration.h b/Sources/Sentry/include/SentryBaseIntegration.h index da8501ee19a..c620ab20205 100644 --- a/Sources/Sentry/include/SentryBaseIntegration.h +++ b/Sources/Sentry/include/SentryBaseIntegration.h @@ -6,7 +6,7 @@ NS_ASSUME_NONNULL_BEGIN typedef NS_OPTIONS(NSUInteger, SentryIntegrationOption) { kIntegrationOptionNone = 0, kIntegrationOptionEnableAutoSessionTracking = 1 << 0, - kIntegrationOptionEnableWatchdogTerminationsTracking = 1 << 1, + kIntegrationOptionEnableWatchdogTerminationTracking = 1 << 1, kIntegrationOptionEnableAutoPerformanceTracing = 1 << 2, kIntegrationOptionEnableUIViewControllerTracing = 1 << 3, kIntegrationOptionAttachScreenshot = 1 << 4, diff --git a/Tests/SentryTests/Integrations/Performance/AppStartTracking/SentryAppStartTrackerTests.swift b/Tests/SentryTests/Integrations/Performance/AppStartTracking/SentryAppStartTrackerTests.swift index 66681344dae..e863d939db6 100644 --- a/Tests/SentryTests/Integrations/Performance/AppStartTracking/SentryAppStartTrackerTests.swift +++ b/Tests/SentryTests/Integrations/Performance/AppStartTracking/SentryAppStartTrackerTests.swift @@ -103,7 +103,7 @@ class SentryAppStartTrackerTests: NotificationCenterTestCase { func testSecondStart_SystemNotRebooted_OOM_disabled_IsWarmStart() { givenSystemNotRebooted() - fixture.options.enableWatchdogTerminationsTracking = false + fixture.options.enableWatchdogTerminationTracking = false fixture.fileManager.moveAppStateToPreviousAppState() startApp() diff --git a/Tests/SentryTests/Integrations/SentryCrash/SentryCrashIntegrationTests.swift b/Tests/SentryTests/Integrations/SentryCrash/SentryCrashIntegrationTests.swift index 6554ffc3ed7..72a59b9f7ac 100644 --- a/Tests/SentryTests/Integrations/SentryCrash/SentryCrashIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/SentryCrash/SentryCrashIntegrationTests.swift @@ -143,7 +143,7 @@ class SentryCrashIntegrationTests: NotificationCenterTestCase { let sut = fixture.sutWithoutCrash let options = fixture.options - options.enableWatchdogTerminationsTracking = false + options.enableWatchdogTerminationTracking = false sut.install(with: options) let fileManager = fixture.client.fileManager diff --git a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift index d9a04135044..9d07f6199c0 100644 --- a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift @@ -93,7 +93,7 @@ class SentryWatchdogTerminationsIntegrationTests: XCTestCase { func test_OOMDisabled_RemovesEnabledIntegration() { givenInitializedTracker() let options = Options() - options.enableWatchdogTerminationsTracking = false + options.enableWatchdogTerminationTracking = false let sut = SentryWatchdogTerminationsTrackingIntegration() let result = sut.install(with: options) diff --git a/Tests/SentryTests/SentryOptionsTest.m b/Tests/SentryTests/SentryOptionsTest.m index 7681b50f555..d64183847ae 100644 --- a/Tests/SentryTests/SentryOptionsTest.m +++ b/Tests/SentryTests/SentryOptionsTest.m @@ -93,7 +93,7 @@ - (void)assertDefaultValues:(SentryOptions *)options @"Default integrations are not set correctly"); XCTAssertEqual(@1, options.sampleRate); XCTAssertEqual(YES, options.enableAutoSessionTracking); - XCTAssertEqual(YES, options.enableWatchdogTerminationsTracking); + XCTAssertEqual(YES, options.enableWatchdogTerminationTracking); XCTAssertEqual([@30000 unsignedIntValue], options.sessionTrackingIntervalMillis); XCTAssertEqual(YES, options.attachStacktrace); XCTAssertEqual(NO, options.stitchAsyncCode); diff --git a/scripts/set-device-tests-environment.patch b/scripts/set-device-tests-environment.patch index 43f5c8f62fc..38491cf7c52 100644 --- a/scripts/set-device-tests-environment.patch +++ b/scripts/set-device-tests-environment.patch @@ -8,7 +8,7 @@ index 25b92eed..8934d90b 100644 options.enableFileIOTracing = true + options.environment = "device-tests" + // The UI tests generate false OOMs -+ options.enableWatchdogTerminationsTracking = false ++ options.enableWatchdogTerminationTracking = false options.enableCoreDataTracing = true options.profilesSampleRate = 1.0 options.attachScreenshot = true From 3458c6ab4ec4605684f41d00cbf50c0f09cc6c62 Mon Sep 17 00:00:00 2001 From: Kevin Renskers Date: Mon, 12 Dec 2022 15:03:27 +0100 Subject: [PATCH 2/2] Rename the entire integration --- Sentry.xcodeproj/project.pbxproj | 64 +++++++++---------- Sources/Sentry/Public/SentryOptions.h | 2 +- Sources/Sentry/SentryClient.m | 2 +- Sources/Sentry/SentryCrashIntegration.m | 12 ++-- Sources/Sentry/SentryOptions.m | 2 +- Sources/Sentry/SentrySessionCrashedHandler.m | 10 +-- ...gic.m => SentryWatchdogTerminationLogic.m} | 6 +- ... SentryWatchdogTerminationScopeObserver.m} | 6 +- ...r.m => SentryWatchdogTerminationTracker.m} | 18 +++--- ...yWatchdogTerminationTrackingIntegration.m} | 36 +++++------ .../include/SentrySessionCrashedHandler.h | 4 +- ...gic.h => SentryWatchdogTerminationLogic.h} | 2 +- ... SentryWatchdogTerminationScopeObserver.h} | 4 +- ...r.h => SentryWatchdogTerminationTracker.h} | 6 +- ...yWatchdogTerminationTrackingIntegration.h} | 2 +- .../Helper/SentryFileManagerTests.swift | 4 +- ...WatchdogTerminationsIntegrationTests.swift | 14 ++-- ...tchdogTerminationsScopeObserverTests.swift | 10 +-- ...ntryWatchdogTerminationsTrackerTests.swift | 20 +++--- Tests/SentryTests/SentrySDKTests.swift | 2 +- .../SentryTests/SentryTests-Bridging-Header.h | 8 +-- 21 files changed, 117 insertions(+), 117 deletions(-) rename Sources/Sentry/{SentryWatchdogTerminationsLogic.m => SentryWatchdogTerminationLogic.m} (96%) rename Sources/Sentry/{SentryWatchdogTerminationsScopeObserver.m => SentryWatchdogTerminationScopeObserver.m} (95%) rename Sources/Sentry/{SentryWatchdogTerminationsTracker.m => SentryWatchdogTerminationTracker.m} (85%) rename Sources/Sentry/{SentryWatchdogTerminationsTrackingIntegration.m => SentryWatchdogTerminationTrackingIntegration.m} (72%) rename Sources/Sentry/include/{SentryWatchdogTerminationsLogic.h => SentryWatchdogTerminationLogic.h} (88%) rename Sources/Sentry/include/{SentryWatchdogTerminationsScopeObserver.h => SentryWatchdogTerminationScopeObserver.h} (66%) rename Sources/Sentry/include/{SentryWatchdogTerminationsTracker.h => SentryWatchdogTerminationTracker.h} (81%) rename Sources/Sentry/include/{SentryWatchdogTerminationsTrackingIntegration.h => SentryWatchdogTerminationTrackingIntegration.h} (82%) diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index ad48f5d6f6e..fcb49c46b90 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -52,8 +52,8 @@ 0A5370A128A3EC2400B2DCDE /* SentryViewHierarchyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A5370A028A3EC2400B2DCDE /* SentryViewHierarchyTests.swift */; }; 0A56DA5F28ABA01B00C400D5 /* SentryTransactionContext+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A56DA5E28ABA01B00C400D5 /* SentryTransactionContext+Private.h */; }; 0A6EEADD28A657970076B469 /* UIViewRecursiveDescriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A6EEADC28A657970076B469 /* UIViewRecursiveDescriptionTests.swift */; }; - 0A80E433291017C300095219 /* SentryWatchdogTerminationsScopeObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A80E432291017C300095219 /* SentryWatchdogTerminationsScopeObserver.m */; }; - 0A80E435291017D500095219 /* SentryWatchdogTerminationsScopeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A80E434291017D500095219 /* SentryWatchdogTerminationsScopeObserver.h */; }; + 0A80E433291017C300095219 /* SentryWatchdogTerminationScopeObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A80E432291017C300095219 /* SentryWatchdogTerminationScopeObserver.m */; }; + 0A80E435291017D500095219 /* SentryWatchdogTerminationScopeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A80E434291017D500095219 /* SentryWatchdogTerminationScopeObserver.h */; }; 0A8F0A392886CC70000B15F6 /* SentryPermissionsObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AABE2EE288592750057ED69 /* SentryPermissionsObserver.h */; }; 0A94158228F6C4C2006A5DD1 /* SentryAppStateManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A94158128F6C4C2006A5DD1 /* SentryAppStateManagerTests.swift */; }; 0A9415BA28F96CAC006A5DD1 /* TestSentryReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9415B928F96CAC006A5DD1 /* TestSentryReachability.swift */; }; @@ -371,8 +371,8 @@ 7B6C5EDC264E8DA80010D138 /* SentryFramesTrackingIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B6C5EDB264E8DA80010D138 /* SentryFramesTrackingIntegration.m */; }; 7B6C5EDE264E8DF00010D138 /* SentryFramesTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B6C5EDD264E8DF00010D138 /* SentryFramesTracker.m */; }; 7B6C5EE0264E8E050010D138 /* SentryFramesTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B6C5EDF264E8E050010D138 /* SentryFramesTracker.h */; }; - 7B6C5F8126034354007F7DFF /* SentryWatchdogTerminationsLogic.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B6C5F8026034354007F7DFF /* SentryWatchdogTerminationsLogic.h */; }; - 7B6C5F8726034395007F7DFF /* SentryWatchdogTerminationsLogic.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationsLogic.m */; }; + 7B6C5F8126034354007F7DFF /* SentryWatchdogTerminationLogic.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B6C5F8026034354007F7DFF /* SentryWatchdogTerminationLogic.h */; }; + 7B6C5F8726034395007F7DFF /* SentryWatchdogTerminationLogic.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationLogic.m */; }; 7B6CC50224EE5A42001816D7 /* SentryHubTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6CC50124EE5A42001816D7 /* SentryHubTests.swift */; }; 7B6D1261265F784000C9BE4B /* PrivateSentrySDKOnly.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B6D1260265F784000C9BE4B /* PrivateSentrySDKOnly.m */; }; 7B6D1263265F7CC600C9BE4B /* PrivateSentrySDKOnlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6D1262265F7CC600C9BE4B /* PrivateSentrySDKOnlyTests.swift */; }; @@ -423,10 +423,10 @@ 7B9657262683104C00C66E25 /* NSData+Sentry.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B9657242683104C00C66E25 /* NSData+Sentry.m */; }; 7B965728268321CD00C66E25 /* SentryCrashScopeObserverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B965727268321CD00C66E25 /* SentryCrashScopeObserverTests.swift */; }; 7B984A9F28E572AF001F4BEE /* CrashReportWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B984A9E28E572AF001F4BEE /* CrashReportWriter.swift */; }; - 7B98D7BC25FB607300C5A389 /* SentryWatchdogTerminationsTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D7BB25FB607300C5A389 /* SentryWatchdogTerminationsTracker.h */; }; - 7B98D7CB25FB64EC00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D7CA25FB64EC00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.h */; }; - 7B98D7CF25FB650F00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D7CE25FB650F00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.m */; }; - 7B98D7D325FB65AE00C5A389 /* SentryWatchdogTerminationsTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D7D225FB65AE00C5A389 /* SentryWatchdogTerminationsTracker.m */; }; + 7B98D7BC25FB607300C5A389 /* SentryWatchdogTerminationTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D7BB25FB607300C5A389 /* SentryWatchdogTerminationTracker.h */; }; + 7B98D7CB25FB64EC00C5A389 /* SentryWatchdogTerminationTrackingIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D7CA25FB64EC00C5A389 /* SentryWatchdogTerminationTrackingIntegration.h */; }; + 7B98D7CF25FB650F00C5A389 /* SentryWatchdogTerminationTrackingIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D7CE25FB650F00C5A389 /* SentryWatchdogTerminationTrackingIntegration.m */; }; + 7B98D7D325FB65AE00C5A389 /* SentryWatchdogTerminationTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D7D225FB65AE00C5A389 /* SentryWatchdogTerminationTracker.m */; }; 7B98D7E025FB73B900C5A389 /* SentryWatchdogTerminationsTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D7DF25FB73B900C5A389 /* SentryWatchdogTerminationsTrackerTests.swift */; }; 7B98D7E425FB7A7200C5A389 /* SentryAppState.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D7E325FB7A7200C5A389 /* SentryAppState.h */; }; 7B98D7E825FB7BCD00C5A389 /* SentryAppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D7E725FB7BCD00C5A389 /* SentryAppState.m */; }; @@ -807,8 +807,8 @@ 0A5370A028A3EC2400B2DCDE /* SentryViewHierarchyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyTests.swift; sourceTree = ""; }; 0A56DA5E28ABA01B00C400D5 /* SentryTransactionContext+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryTransactionContext+Private.h"; path = "include/SentryTransactionContext+Private.h"; sourceTree = ""; }; 0A6EEADC28A657970076B469 /* UIViewRecursiveDescriptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewRecursiveDescriptionTests.swift; sourceTree = ""; }; - 0A80E432291017C300095219 /* SentryWatchdogTerminationsScopeObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationsScopeObserver.m; sourceTree = ""; }; - 0A80E434291017D500095219 /* SentryWatchdogTerminationsScopeObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationsScopeObserver.h; path = include/SentryWatchdogTerminationsScopeObserver.h; sourceTree = ""; }; + 0A80E432291017C300095219 /* SentryWatchdogTerminationScopeObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationScopeObserver.m; sourceTree = ""; }; + 0A80E434291017D500095219 /* SentryWatchdogTerminationScopeObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationScopeObserver.h; path = include/SentryWatchdogTerminationScopeObserver.h; sourceTree = ""; }; 0A94158128F6C4C2006A5DD1 /* SentryAppStateManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAppStateManagerTests.swift; sourceTree = ""; }; 0A9415B928F96CAC006A5DD1 /* TestSentryReachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryReachability.swift; sourceTree = ""; }; 0A9BF4E128A114940068D266 /* SentryViewHierarchyIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryViewHierarchyIntegration.m; sourceTree = ""; }; @@ -1146,8 +1146,8 @@ 7B6C5EDB264E8DA80010D138 /* SentryFramesTrackingIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryFramesTrackingIntegration.m; sourceTree = ""; }; 7B6C5EDD264E8DF00010D138 /* SentryFramesTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryFramesTracker.m; sourceTree = ""; }; 7B6C5EDF264E8E050010D138 /* SentryFramesTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryFramesTracker.h; path = include/SentryFramesTracker.h; sourceTree = ""; }; - 7B6C5F8026034354007F7DFF /* SentryWatchdogTerminationsLogic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationsLogic.h; path = include/SentryWatchdogTerminationsLogic.h; sourceTree = ""; }; - 7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationsLogic.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationsLogic.m; sourceTree = ""; }; + 7B6C5F8026034354007F7DFF /* SentryWatchdogTerminationLogic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationLogic.h; path = include/SentryWatchdogTerminationLogic.h; sourceTree = ""; }; + 7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationLogic.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationLogic.m; sourceTree = ""; }; 7B6CC50124EE5A42001816D7 /* SentryHubTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryHubTests.swift; sourceTree = ""; }; 7B6D1260265F784000C9BE4B /* PrivateSentrySDKOnly.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrivateSentrySDKOnly.m; sourceTree = ""; }; 7B6D1262265F7CC600C9BE4B /* PrivateSentrySDKOnlyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivateSentrySDKOnlyTests.swift; sourceTree = ""; }; @@ -1202,10 +1202,10 @@ 7B965727268321CD00C66E25 /* SentryCrashScopeObserverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashScopeObserverTests.swift; sourceTree = ""; }; 7B9660B12783500E0014A767 /* ThreadSanitizer.sup */ = {isa = PBXFileReference; lastKnownFileType = text; path = ThreadSanitizer.sup; sourceTree = ""; }; 7B984A9E28E572AF001F4BEE /* CrashReportWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReportWriter.swift; sourceTree = ""; }; - 7B98D7BB25FB607300C5A389 /* SentryWatchdogTerminationsTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationsTracker.h; path = include/SentryWatchdogTerminationsTracker.h; sourceTree = ""; }; - 7B98D7CA25FB64EC00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationsTrackingIntegration.h; path = include/SentryWatchdogTerminationsTrackingIntegration.h; sourceTree = ""; }; - 7B98D7CE25FB650F00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationsTrackingIntegration.m; sourceTree = ""; }; - 7B98D7D225FB65AE00C5A389 /* SentryWatchdogTerminationsTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationsTracker.m; sourceTree = ""; }; + 7B98D7BB25FB607300C5A389 /* SentryWatchdogTerminationTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationTracker.h; path = include/SentryWatchdogTerminationTracker.h; sourceTree = ""; }; + 7B98D7CA25FB64EC00C5A389 /* SentryWatchdogTerminationTrackingIntegration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWatchdogTerminationTrackingIntegration.h; path = include/SentryWatchdogTerminationTrackingIntegration.h; sourceTree = ""; }; + 7B98D7CE25FB650F00C5A389 /* SentryWatchdogTerminationTrackingIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationTrackingIntegration.m; sourceTree = ""; }; + 7B98D7D225FB65AE00C5A389 /* SentryWatchdogTerminationTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryWatchdogTerminationTracker.m; sourceTree = ""; }; 7B98D7DF25FB73B900C5A389 /* SentryWatchdogTerminationsTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryWatchdogTerminationsTrackerTests.swift; sourceTree = ""; }; 7B98D7E325FB7A7200C5A389 /* SentryAppState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryAppState.h; path = include/SentryAppState.h; sourceTree = ""; }; 7B98D7E725FB7BCD00C5A389 /* SentryAppState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAppState.m; sourceTree = ""; }; @@ -2562,14 +2562,14 @@ 7BE0DC34272AE78C004FA8B7 /* WatchdogTerminations */ = { isa = PBXGroup; children = ( - 7B98D7BB25FB607300C5A389 /* SentryWatchdogTerminationsTracker.h */, - 7B98D7D225FB65AE00C5A389 /* SentryWatchdogTerminationsTracker.m */, - 7B6C5F8026034354007F7DFF /* SentryWatchdogTerminationsLogic.h */, - 7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationsLogic.m */, - 7B98D7CA25FB64EC00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.h */, - 7B98D7CE25FB650F00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.m */, - 0A80E434291017D500095219 /* SentryWatchdogTerminationsScopeObserver.h */, - 0A80E432291017C300095219 /* SentryWatchdogTerminationsScopeObserver.m */, + 7B98D7BB25FB607300C5A389 /* SentryWatchdogTerminationTracker.h */, + 7B98D7D225FB65AE00C5A389 /* SentryWatchdogTerminationTracker.m */, + 7B6C5F8026034354007F7DFF /* SentryWatchdogTerminationLogic.h */, + 7B6C5F8626034395007F7DFF /* SentryWatchdogTerminationLogic.m */, + 7B98D7CA25FB64EC00C5A389 /* SentryWatchdogTerminationTrackingIntegration.h */, + 7B98D7CE25FB650F00C5A389 /* SentryWatchdogTerminationTrackingIntegration.m */, + 0A80E434291017D500095219 /* SentryWatchdogTerminationScopeObserver.h */, + 0A80E432291017C300095219 /* SentryWatchdogTerminationScopeObserver.m */, ); name = WatchdogTerminations; sourceTree = ""; @@ -3058,7 +3058,7 @@ 7BCFBD672681C95000BC27D8 /* SentryScopeObserver.h in Headers */, D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */, D88817DA26D72AB800BF2251 /* SentryTraceContext.h in Headers */, - 7B6C5F8126034354007F7DFF /* SentryWatchdogTerminationsLogic.h in Headers */, + 7B6C5F8126034354007F7DFF /* SentryWatchdogTerminationLogic.h in Headers */, 63FE708520DA4C1000CDBAE8 /* SentryCrashReportFilter.h in Headers */, D8ACE3CD2762187D00F5A213 /* SentryNSDataSwizzling.h in Headers */, 7B08A3452924CF6C0059603A /* SentryMetricKitIntegration.h in Headers */, @@ -3214,7 +3214,7 @@ 8E5D38E3261D4B57000D363D /* SentryPerformanceTrackingIntegration.h in Headers */, 63FE70F920DA4C1000CDBAE8 /* SentryCrashMonitor.h in Headers */, D8BD2E6829361A0F00D96C6A /* PrivatesHeader.h in Headers */, - 7B98D7CB25FB64EC00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.h in Headers */, + 7B98D7CB25FB64EC00C5A389 /* SentryWatchdogTerminationTrackingIntegration.h in Headers */, 63FE710920DA4C1000CDBAE8 /* SentryCrashFileUtils.h in Headers */, 03F84D1F27DD414C008FE43F /* SentryAsyncSafeLogging.h in Headers */, 7BE3C76B2445C27A00A38442 /* SentryCurrentDateProvider.h in Headers */, @@ -3278,7 +3278,7 @@ 7BC5B6FA290BCDE500D99477 /* SentryHttpStatusCodeRange+Private.h in Headers */, 7B04A9AF24EAC02C00E710B1 /* SentryRetryAfterHeaderParser.h in Headers */, 7DC83100239826280043DD9A /* SentryIntegrationProtocol.h in Headers */, - 7B98D7BC25FB607300C5A389 /* SentryWatchdogTerminationsTracker.h in Headers */, + 7B98D7BC25FB607300C5A389 /* SentryWatchdogTerminationTracker.h in Headers */, 7BA61CB9247BC57B00C130A8 /* SentryCrashDefaultBinaryImageProvider.h in Headers */, 8E4E7C7D25DAB287006AB9E2 /* SentryTracer.h in Headers */, 7BC8523724588115005A70F0 /* SentryDataCategory.h in Headers */, @@ -3291,7 +3291,7 @@ 7B42C48027E08F33009B58C2 /* SentryDependencyContainer.h in Headers */, 6334314120AD9AE40077E581 /* SentryMechanism.h in Headers */, 03F84D2827DD414C008FE43F /* SentryCPU.h in Headers */, - 0A80E435291017D500095219 /* SentryWatchdogTerminationsScopeObserver.h in Headers */, + 0A80E435291017D500095219 /* SentryWatchdogTerminationScopeObserver.h in Headers */, 7B610D642512399600B0B5D9 /* SentryHub+Private.h in Headers */, D8F6A24B2885515C00320515 /* SentryPredicateDescriptor.h in Headers */, 639FCF9C1EBC7F9500778193 /* SentryThread.h in Headers */, @@ -3467,7 +3467,7 @@ 7B6438AB26A70F24000D0F65 /* UIViewController+Sentry.m in Sources */, 63AA76A31EB9CBAA00D153DE /* SentryDsn.m in Sources */, 63B818FA1EC34639002FDF4C /* SentryDebugMeta.m in Sources */, - 7B98D7D325FB65AE00C5A389 /* SentryWatchdogTerminationsTracker.m in Sources */, + 7B98D7D325FB65AE00C5A389 /* SentryWatchdogTerminationTracker.m in Sources */, 8E564AE8267AF22600FE117D /* SentryNetworkTrackingIntegration.m in Sources */, 63AA75EF1EB8B3C400D153DE /* SentryClient.m in Sources */, 7B7D873624864C9D00D2ECFF /* SentryCrashDefaultMachineContextWrapper.m in Sources */, @@ -3505,7 +3505,7 @@ 63AA769E1EB9C57A00D153DE /* SentryError.m in Sources */, 7B8713B026415B22006D6004 /* SentryAppStartTrackingIntegration.m in Sources */, 8E133FA225E72DEF00ABD0BF /* SentrySamplingContext.m in Sources */, - 7B6C5F8726034395007F7DFF /* SentryWatchdogTerminationsLogic.m in Sources */, + 7B6C5F8726034395007F7DFF /* SentryWatchdogTerminationLogic.m in Sources */, 7BBC827125DFD039005F1ED8 /* SentryInAppLogic.m in Sources */, 63FE708D20DA4C1000CDBAE8 /* SentryCrashReportFilterBasic.m in Sources */, 63FE718120DA4C1100CDBAE8 /* SentryCrashDoctor.m in Sources */, @@ -3553,7 +3553,7 @@ 84A8891D28DBD28900C51DFD /* SentryDevice.mm in Sources */, 7B56D73324616D9500B842DA /* SentryConcurrentRateLimitsDictionary.m in Sources */, 8ECC674825C23A20000E2BF6 /* SentryTransaction.m in Sources */, - 0A80E433291017C300095219 /* SentryWatchdogTerminationsScopeObserver.m in Sources */, + 0A80E433291017C300095219 /* SentryWatchdogTerminationScopeObserver.m in Sources */, 7BECF42826145CD900D9826E /* SentryMechanismMeta.m in Sources */, 8E7C982F2693D56000E6336C /* SentryTraceHeader.m in Sources */, 63FE715F20DA4C1100CDBAE8 /* SentryCrashID.c in Sources */, @@ -3617,7 +3617,7 @@ 03F84D3527DD4191008FE43F /* SentryThreadHandle.cpp in Sources */, 0A2D8DA9289BC905008720F6 /* SentryViewHierarchy.m in Sources */, 8EA1ED0B2668F8C400E62B98 /* SentryUIViewControllerSwizzling.m in Sources */, - 7B98D7CF25FB650F00C5A389 /* SentryWatchdogTerminationsTrackingIntegration.m in Sources */, + 7B98D7CF25FB650F00C5A389 /* SentryWatchdogTerminationTrackingIntegration.m in Sources */, 8E5D38DD261D4A3E000D363D /* SentryPerformanceTrackingIntegration.m in Sources */, 7B4E23C2251A2C2B00060D68 /* SentrySessionCrashedHandler.m in Sources */, 7B42C48227E08F4B009B58C2 /* SentryDependencyContainer.m in Sources */, diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 3a005a16814..6ff0b9b7995 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -136,7 +136,7 @@ NS_SWIFT_NAME(Options) @property (nonatomic, assign) BOOL enableAutoSessionTracking; /** - * Whether to enable Watchdog Terminations tracking or not. Default is YES. + * Whether to enable Watchdog Termination tracking or not. Default is YES. */ @property (nonatomic, assign) BOOL enableWatchdogTerminationTracking; diff --git a/Sources/Sentry/SentryClient.m b/Sources/Sentry/SentryClient.m index 4b910f1ca13..bf3f6c61ee2 100644 --- a/Sources/Sentry/SentryClient.m +++ b/Sources/Sentry/SentryClient.m @@ -44,7 +44,7 @@ #import "SentryUIDeviceWrapper.h" #import "SentryUser.h" #import "SentryUserFeedback.h" -#import "SentryWatchdogTerminationsTracker.h" +#import "SentryWatchdogTerminationTracker.h" #if SENTRY_HAS_UIKIT # import diff --git a/Sources/Sentry/SentryCrashIntegration.m b/Sources/Sentry/SentryCrashIntegration.m index cecd9f629c9..65301034ac8 100644 --- a/Sources/Sentry/SentryCrashIntegration.m +++ b/Sources/Sentry/SentryCrashIntegration.m @@ -8,7 +8,7 @@ #import "SentrySDK+Private.h" #import "SentryScope+Private.h" #import "SentrySessionCrashedHandler.h" -#import "SentryWatchdogTerminationsLogic.h" +#import "SentryWatchdogTerminationLogic.h" #import #import #import @@ -70,13 +70,13 @@ - (BOOL)installWithOptions:(nonnull SentryOptions *)options SentryAppStateManager *appStateManager = [SentryDependencyContainer sharedInstance].appStateManager; - SentryWatchdogTerminationsLogic *logic = - [[SentryWatchdogTerminationsLogic alloc] initWithOptions:options - crashAdapter:self.crashAdapter - appStateManager:appStateManager]; + SentryWatchdogTerminationLogic *logic = + [[SentryWatchdogTerminationLogic alloc] initWithOptions:options + crashAdapter:self.crashAdapter + appStateManager:appStateManager]; self.crashedSessionHandler = [[SentrySessionCrashedHandler alloc] initWithCrashWrapper:self.crashAdapter - watchdogTerminationsLogic:logic]; + watchdogTerminationLogic:logic]; self.scopeObserver = [[SentryCrashScopeObserver alloc] initWithMaxBreadcrumbs:options.maxBreadcrumbs]; diff --git a/Sources/Sentry/SentryOptions.m b/Sources/Sentry/SentryOptions.m index 9dddabf4baa..f42ef5a9dcc 100644 --- a/Sources/Sentry/SentryOptions.m +++ b/Sources/Sentry/SentryOptions.m @@ -38,7 +38,7 @@ - (void)setMeasurement:(SentryMeasurementValue *)measurement #endif @"SentryFramesTrackingIntegration", @"SentryAutoBreadcrumbTrackingIntegration", @"SentryAutoSessionTrackingIntegration", @"SentryAppStartTrackingIntegration", - @"SentryWatchdogTerminationsTrackingIntegration", + @"SentryWatchdogTerminationTrackingIntegration", @"SentryPerformanceTrackingIntegration", @"SentryNetworkTrackingIntegration", @"SentryFileIOTrackingIntegration", @"SentryCoreDataTrackingIntegration" ] diff --git a/Sources/Sentry/SentrySessionCrashedHandler.m b/Sources/Sentry/SentrySessionCrashedHandler.m index 44f15774506..24eaee0d1e9 100644 --- a/Sources/Sentry/SentrySessionCrashedHandler.m +++ b/Sources/Sentry/SentrySessionCrashedHandler.m @@ -5,24 +5,24 @@ #import "SentryFileManager.h" #import "SentryHub.h" #import "SentrySDK+Private.h" -#import "SentryWatchdogTerminationsLogic.h" +#import "SentryWatchdogTerminationLogic.h" @interface SentrySessionCrashedHandler () @property (nonatomic, strong) SentryCrashWrapper *crashWrapper; -@property (nonatomic, strong) SentryWatchdogTerminationsLogic *watchdogTerminationsLogic; +@property (nonatomic, strong) SentryWatchdogTerminationLogic *watchdogTerminationLogic; @end @implementation SentrySessionCrashedHandler - (instancetype)initWithCrashWrapper:(SentryCrashWrapper *)crashWrapper - watchdogTerminationsLogic:(SentryWatchdogTerminationsLogic *)watchdogTerminationsLogic; + watchdogTerminationLogic:(SentryWatchdogTerminationLogic *)watchdogTerminationLogic; { self = [self init]; self.crashWrapper = crashWrapper; - self.watchdogTerminationsLogic = watchdogTerminationsLogic; + self.watchdogTerminationLogic = watchdogTerminationLogic; return self; } @@ -30,7 +30,7 @@ - (instancetype)initWithCrashWrapper:(SentryCrashWrapper *)crashWrapper - (void)endCurrentSessionAsCrashedWhenCrashOrOOM { if (self.crashWrapper.crashedLastLaunch || - [self.watchdogTerminationsLogic isWatchdogTermination]) { + [self.watchdogTerminationLogic isWatchdogTermination]) { SentryFileManager *fileManager = [[[SentrySDK currentHub] getClient] fileManager]; if (nil == fileManager) { diff --git a/Sources/Sentry/SentryWatchdogTerminationsLogic.m b/Sources/Sentry/SentryWatchdogTerminationLogic.m similarity index 96% rename from Sources/Sentry/SentryWatchdogTerminationsLogic.m rename to Sources/Sentry/SentryWatchdogTerminationLogic.m index ca4952fec56..5b1169a49c2 100644 --- a/Sources/Sentry/SentryWatchdogTerminationsLogic.m +++ b/Sources/Sentry/SentryWatchdogTerminationLogic.m @@ -4,14 +4,14 @@ #import #import #import -#import +#import #if SENTRY_HAS_UIKIT # import #endif @interface -SentryWatchdogTerminationsLogic () +SentryWatchdogTerminationLogic () @property (nonatomic, strong) SentryOptions *options; @property (nonatomic, strong) SentryCrashWrapper *crashAdapter; @@ -19,7 +19,7 @@ @end -@implementation SentryWatchdogTerminationsLogic +@implementation SentryWatchdogTerminationLogic - (instancetype)initWithOptions:(SentryOptions *)options crashAdapter:(SentryCrashWrapper *)crashAdapter diff --git a/Sources/Sentry/SentryWatchdogTerminationsScopeObserver.m b/Sources/Sentry/SentryWatchdogTerminationScopeObserver.m similarity index 95% rename from Sources/Sentry/SentryWatchdogTerminationsScopeObserver.m rename to Sources/Sentry/SentryWatchdogTerminationScopeObserver.m index 74b0878fcb0..7c0127504d5 100644 --- a/Sources/Sentry/SentryWatchdogTerminationsScopeObserver.m +++ b/Sources/Sentry/SentryWatchdogTerminationScopeObserver.m @@ -1,10 +1,10 @@ -#import "SentryWatchdogTerminationsScopeObserver.h" +#import "SentryWatchdogTerminationScopeObserver.h" #import #import #import @interface -SentryWatchdogTerminationsScopeObserver () +SentryWatchdogTerminationScopeObserver () @property (strong, nonatomic) SentryFileManager *fileManager; @property (strong, nonatomic) NSFileHandle *fileHandle; @@ -14,7 +14,7 @@ @end -@implementation SentryWatchdogTerminationsScopeObserver +@implementation SentryWatchdogTerminationScopeObserver - (instancetype)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs fileManager:(SentryFileManager *)fileManager diff --git a/Sources/Sentry/SentryWatchdogTerminationsTracker.m b/Sources/Sentry/SentryWatchdogTerminationTracker.m similarity index 85% rename from Sources/Sentry/SentryWatchdogTerminationsTracker.m rename to Sources/Sentry/SentryWatchdogTerminationTracker.m index 7480ea68026..cc4dbe3d419 100644 --- a/Sources/Sentry/SentryWatchdogTerminationsTracker.m +++ b/Sources/Sentry/SentryWatchdogTerminationTracker.m @@ -13,35 +13,35 @@ #import #import #import -#import -#import +#import +#import #if SENTRY_HAS_UIKIT # import #endif @interface -SentryWatchdogTerminationsTracker () +SentryWatchdogTerminationTracker () @property (nonatomic, strong) SentryOptions *options; -@property (nonatomic, strong) SentryWatchdogTerminationsLogic *watchdogTerminationsLogic; +@property (nonatomic, strong) SentryWatchdogTerminationLogic *watchdogTerminationLogic; @property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueue; @property (nonatomic, strong) SentryAppStateManager *appStateManager; @property (nonatomic, strong) SentryFileManager *fileManager; @end -@implementation SentryWatchdogTerminationsTracker +@implementation SentryWatchdogTerminationTracker - (instancetype)initWithOptions:(SentryOptions *)options - watchdogTerminationsLogic:(SentryWatchdogTerminationsLogic *)watchdogTerminationsLogic + watchdogTerminationLogic:(SentryWatchdogTerminationLogic *)watchdogTerminationLogic appStateManager:(SentryAppStateManager *)appStateManager dispatchQueueWrapper:(SentryDispatchQueueWrapper *)dispatchQueueWrapper fileManager:(SentryFileManager *)fileManager { if (self = [super init]) { self.options = options; - self.watchdogTerminationsLogic = watchdogTerminationsLogic; + self.watchdogTerminationLogic = watchdogTerminationLogic; self.appStateManager = appStateManager; self.dispatchQueue = dispatchQueueWrapper; self.fileManager = fileManager; @@ -55,7 +55,7 @@ - (void)start [self.appStateManager start]; [self.dispatchQueue dispatchAsyncWithBlock:^{ - if ([self.watchdogTerminationsLogic isWatchdogTermination]) { + if ([self.watchdogTerminationLogic isWatchdogTermination]) { SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelFatal]; // Set to empty list so no breadcrumbs of the current scope are added event.breadcrumbs = @[]; @@ -91,7 +91,7 @@ - (void)start }]; #else SENTRY_LOG_INFO( - @"NO UIKit -> SentryWatchdogTerminationsTracker will not track Watchdog Terminations."); + @"NO UIKit -> SentryWatchdogTerminationTracker will not track Watchdog Terminations."); return; #endif } diff --git a/Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m b/Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m similarity index 72% rename from Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m rename to Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m index da4724972c8..a38620d1bcb 100644 --- a/Sources/Sentry/SentryWatchdogTerminationsTrackingIntegration.m +++ b/Sources/Sentry/SentryWatchdogTerminationTrackingIntegration.m @@ -9,24 +9,24 @@ #import #import #import -#import -#import -#import -#import +#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN @interface -SentryWatchdogTerminationsTrackingIntegration () +SentryWatchdogTerminationTrackingIntegration () -@property (nonatomic, strong) SentryWatchdogTerminationsTracker *tracker; +@property (nonatomic, strong) SentryWatchdogTerminationTracker *tracker; @property (nonatomic, strong) SentryANRTracker *anrTracker; @property (nullable, nonatomic, copy) NSString *testConfigurationFilePath; @property (nonatomic, strong) SentryAppStateManager *appStateManager; @end -@implementation SentryWatchdogTerminationsTrackingIntegration +@implementation SentryWatchdogTerminationTrackingIntegration - (instancetype)init { @@ -57,16 +57,16 @@ - (BOOL)installWithOptions:(SentryOptions *)options SentryAppStateManager *appStateManager = [SentryDependencyContainer sharedInstance].appStateManager; SentryCrashWrapper *crashWrapper = [SentryDependencyContainer sharedInstance].crashWrapper; - SentryWatchdogTerminationsLogic *logic = - [[SentryWatchdogTerminationsLogic alloc] initWithOptions:options - crashAdapter:crashWrapper - appStateManager:appStateManager]; + SentryWatchdogTerminationLogic *logic = + [[SentryWatchdogTerminationLogic alloc] initWithOptions:options + crashAdapter:crashWrapper + appStateManager:appStateManager]; - self.tracker = [[SentryWatchdogTerminationsTracker alloc] initWithOptions:options - watchdogTerminationsLogic:logic - appStateManager:appStateManager - dispatchQueueWrapper:dispatchQueueWrapper - fileManager:fileManager]; + self.tracker = [[SentryWatchdogTerminationTracker alloc] initWithOptions:options + watchdogTerminationLogic:logic + appStateManager:appStateManager + dispatchQueueWrapper:dispatchQueueWrapper + fileManager:fileManager]; [self.tracker start]; @@ -76,8 +76,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options self.appStateManager = appStateManager; - SentryWatchdogTerminationsScopeObserver *scopeObserver = - [[SentryWatchdogTerminationsScopeObserver alloc] + SentryWatchdogTerminationScopeObserver *scopeObserver = + [[SentryWatchdogTerminationScopeObserver alloc] initWithMaxBreadcrumbs:options.maxBreadcrumbs fileManager:[[[SentrySDK currentHub] getClient] fileManager]]; diff --git a/Sources/Sentry/include/SentrySessionCrashedHandler.h b/Sources/Sentry/include/SentrySessionCrashedHandler.h index 570c3da1c8b..fadba4d4c5e 100644 --- a/Sources/Sentry/include/SentrySessionCrashedHandler.h +++ b/Sources/Sentry/include/SentrySessionCrashedHandler.h @@ -1,11 +1,11 @@ #import -@class SentryCrashWrapper, SentryDispatchQueueWrapper, SentryWatchdogTerminationsLogic; +@class SentryCrashWrapper, SentryDispatchQueueWrapper, SentryWatchdogTerminationLogic; @interface SentrySessionCrashedHandler : NSObject - (instancetype)initWithCrashWrapper:(SentryCrashWrapper *)crashWrapper - watchdogTerminationsLogic:(SentryWatchdogTerminationsLogic *)watchdogTerminationsLogic; + watchdogTerminationLogic:(SentryWatchdogTerminationLogic *)watchdogTerminationLogic; /** * When a crash happened the current session is ended as crashed, stored at a different diff --git a/Sources/Sentry/include/SentryWatchdogTerminationsLogic.h b/Sources/Sentry/include/SentryWatchdogTerminationLogic.h similarity index 88% rename from Sources/Sentry/include/SentryWatchdogTerminationsLogic.h rename to Sources/Sentry/include/SentryWatchdogTerminationLogic.h index 69f8f06a45d..c80a6546932 100644 --- a/Sources/Sentry/include/SentryWatchdogTerminationsLogic.h +++ b/Sources/Sentry/include/SentryWatchdogTerminationLogic.h @@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface SentryWatchdogTerminationsLogic : NSObject +@interface SentryWatchdogTerminationLogic : NSObject SENTRY_NO_INIT - (instancetype)initWithOptions:(SentryOptions *)options diff --git a/Sources/Sentry/include/SentryWatchdogTerminationsScopeObserver.h b/Sources/Sentry/include/SentryWatchdogTerminationScopeObserver.h similarity index 66% rename from Sources/Sentry/include/SentryWatchdogTerminationsScopeObserver.h rename to Sources/Sentry/include/SentryWatchdogTerminationScopeObserver.h index d0e8ec2bf42..d89e2d756db 100644 --- a/Sources/Sentry/include/SentryWatchdogTerminationsScopeObserver.h +++ b/Sources/Sentry/include/SentryWatchdogTerminationScopeObserver.h @@ -5,9 +5,9 @@ NS_ASSUME_NONNULL_BEGIN -/// This scope observer is used by the Watchdog Terminations integration to write breadcrumbs to +/// This scope observer is used by the Watchdog Termination integration to write breadcrumbs to /// disk. The overhead is ~0.015 seconds for 1000 breadcrumbs. -@interface SentryWatchdogTerminationsScopeObserver : NSObject +@interface SentryWatchdogTerminationScopeObserver : NSObject SENTRY_NO_INIT - (instancetype)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs diff --git a/Sources/Sentry/include/SentryWatchdogTerminationsTracker.h b/Sources/Sentry/include/SentryWatchdogTerminationTracker.h similarity index 81% rename from Sources/Sentry/include/SentryWatchdogTerminationsTracker.h rename to Sources/Sentry/include/SentryWatchdogTerminationTracker.h index 6ddcc94c88c..bde5f8999b9 100644 --- a/Sources/Sentry/include/SentryWatchdogTerminationsTracker.h +++ b/Sources/Sentry/include/SentryWatchdogTerminationTracker.h @@ -1,6 +1,6 @@ #import "SentryDefines.h" -@class SentryOptions, SentryWatchdogTerminationsLogic, SentryDispatchQueueWrapper, +@class SentryOptions, SentryWatchdogTerminationLogic, SentryDispatchQueueWrapper, SentryAppStateManager, SentryFileManager; NS_ASSUME_NONNULL_BEGIN @@ -15,11 +15,11 @@ static NSString *const SentryWatchdogTerminationMechanismType = @"watchdog_termi * https://engineering.fb.com/2015/08/24/ios/reducing-fooms-in-the-facebook-ios-app/ If a OOM is * detected, the SDK sends it as crash event. Only works for iOS, tvOS and macCatalyst. */ -@interface SentryWatchdogTerminationsTracker : NSObject +@interface SentryWatchdogTerminationTracker : NSObject SENTRY_NO_INIT - (instancetype)initWithOptions:(SentryOptions *)options - watchdogTerminationsLogic:(SentryWatchdogTerminationsLogic *)watchdogTerminationsLogic + watchdogTerminationLogic:(SentryWatchdogTerminationLogic *)watchdogTerminationLogic appStateManager:(SentryAppStateManager *)appStateManager dispatchQueueWrapper:(SentryDispatchQueueWrapper *)dispatchQueueWrapper fileManager:(SentryFileManager *)fileManager; diff --git a/Sources/Sentry/include/SentryWatchdogTerminationsTrackingIntegration.h b/Sources/Sentry/include/SentryWatchdogTerminationTrackingIntegration.h similarity index 82% rename from Sources/Sentry/include/SentryWatchdogTerminationsTrackingIntegration.h rename to Sources/Sentry/include/SentryWatchdogTerminationTrackingIntegration.h index 54fe9e7d0f1..718b112cf7e 100644 --- a/Sources/Sentry/include/SentryWatchdogTerminationsTrackingIntegration.h +++ b/Sources/Sentry/include/SentryWatchdogTerminationTrackingIntegration.h @@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface SentryWatchdogTerminationsTrackingIntegration +@interface SentryWatchdogTerminationTrackingIntegration : SentryBaseIntegration @end diff --git a/Tests/SentryTests/Helper/SentryFileManagerTests.swift b/Tests/SentryTests/Helper/SentryFileManagerTests.swift index 742237a95e6..7791e61a17d 100644 --- a/Tests/SentryTests/Helper/SentryFileManagerTests.swift +++ b/Tests/SentryTests/Helper/SentryFileManagerTests.swift @@ -576,7 +576,7 @@ class SentryFileManagerTests: XCTestCase { } func testReadPreviousBreadcrumbs() { - let observer = SentryWatchdogTerminationsScopeObserver(maxBreadcrumbs: 2, fileManager: sut) + let observer = SentryWatchdogTerminationScopeObserver(maxBreadcrumbs: 2, fileManager: sut) for count in 0..<3 { let crumb = TestData.crumb @@ -595,7 +595,7 @@ class SentryFileManagerTests: XCTestCase { } func testReadPreviousBreadcrumbsCorrectOrderWhenFileTwoHasMoreCrumbs() { - let observer = SentryWatchdogTerminationsScopeObserver(maxBreadcrumbs: 2, fileManager: sut) + let observer = SentryWatchdogTerminationScopeObserver(maxBreadcrumbs: 2, fileManager: sut) for count in 0..<5 { let crumb = TestData.crumb diff --git a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift index 9d07f6199c0..c77d2f5456b 100644 --- a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsIntegrationTests.swift @@ -1,6 +1,6 @@ import XCTest -class SentryWatchdogTerminationsIntegrationTests: XCTestCase { +class SentryWatchdogTerminationIntegrationTests: XCTestCase { private class Fixture { let options: Options @@ -26,7 +26,7 @@ class SentryWatchdogTerminationsIntegrationTests: XCTestCase { } private var fixture: Fixture! - private var sut: SentryWatchdogTerminationsTrackingIntegration! + private var sut: SentryWatchdogTerminationTrackingIntegration! override func setUp() { super.setUp() @@ -43,14 +43,14 @@ class SentryWatchdogTerminationsIntegrationTests: XCTestCase { } func testWhenUnitTests_TrackerNotInitialized() { - let sut = SentryWatchdogTerminationsTrackingIntegration() + let sut = SentryWatchdogTerminationTrackingIntegration() sut.install(with: Options()) XCTAssertNil(Dynamic(sut).tracker.asAnyObject) } func testWhenNoUnitTests_TrackerInitialized() { - let sut = SentryWatchdogTerminationsTrackingIntegration() + let sut = SentryWatchdogTerminationTrackingIntegration() Dynamic(sut).setTestConfigurationFilePath(nil) sut.install(with: Options()) @@ -58,7 +58,7 @@ class SentryWatchdogTerminationsIntegrationTests: XCTestCase { } func testTestConfigurationFilePath() { - let sut = SentryWatchdogTerminationsTrackingIntegration() + let sut = SentryWatchdogTerminationTrackingIntegration() let path = Dynamic(sut).testConfigurationFilePath.asString XCTAssertEqual(path, ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"]) } @@ -95,7 +95,7 @@ class SentryWatchdogTerminationsIntegrationTests: XCTestCase { let options = Options() options.enableWatchdogTerminationTracking = false - let sut = SentryWatchdogTerminationsTrackingIntegration() + let sut = SentryWatchdogTerminationTrackingIntegration() let result = sut.install(with: options) XCTAssertFalse(result) @@ -103,7 +103,7 @@ class SentryWatchdogTerminationsIntegrationTests: XCTestCase { private func givenInitializedTracker(isBeingTraced: Bool = false) { fixture.crashWrapper.internalIsBeingTraced = isBeingTraced - sut = SentryWatchdogTerminationsTrackingIntegration() + sut = SentryWatchdogTerminationTrackingIntegration() let options = Options() Dynamic(sut).setTestConfigurationFilePath(nil) sut.install(with: options) diff --git a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsScopeObserverTests.swift b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsScopeObserverTests.swift index bdf7904b1d3..9f2f5d3b699 100644 --- a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsScopeObserverTests.swift +++ b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsScopeObserverTests.swift @@ -1,6 +1,6 @@ import XCTest -class SentryWatchdogTerminationsScopeObserverTests: XCTestCase { +class SentryWatchdogTerminationScopeObserverTests: XCTestCase { private class Fixture { let breadcrumb: Breadcrumb let options: Options @@ -16,17 +16,17 @@ class SentryWatchdogTerminationsScopeObserverTests: XCTestCase { fileManager = try! SentryFileManager(options: options, andCurrentDateProvider: currentDate, dispatchQueueWrapper: dispatchQueue) } - func getSut() -> SentryWatchdogTerminationsScopeObserver { + func getSut() -> SentryWatchdogTerminationScopeObserver { return getSut(fileManager: self.fileManager) } - func getSut(fileManager: SentryFileManager) -> SentryWatchdogTerminationsScopeObserver { - return SentryWatchdogTerminationsScopeObserver(maxBreadcrumbs: 10, fileManager: fileManager) + func getSut(fileManager: SentryFileManager) -> SentryWatchdogTerminationScopeObserver { + return SentryWatchdogTerminationScopeObserver(maxBreadcrumbs: 10, fileManager: fileManager) } } private var fixture: Fixture! - private var sut: SentryWatchdogTerminationsScopeObserver! + private var sut: SentryWatchdogTerminationScopeObserver! override func setUp() { super.setUp() diff --git a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsTrackerTests.swift b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsTrackerTests.swift index 50163853936..f081fbae810 100644 --- a/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsTrackerTests.swift +++ b/Tests/SentryTests/Integrations/WatchdogTerminations/SentryWatchdogTerminationsTrackerTests.swift @@ -1,7 +1,7 @@ import XCTest #if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) -class SentryWatchdogTerminationsTrackerTests: NotificationCenterTestCase { +class SentryWatchdogTerminationTrackerTests: NotificationCenterTestCase { private static let dsnAsString = TestConstants.dsnAsString(username: "SentryOutOfMemoryTrackerTests") private static let dsn = TestConstants.dsn(username: "SentryOutOfMemoryTrackerTests") @@ -20,7 +20,7 @@ class SentryWatchdogTerminationsTrackerTests: NotificationCenterTestCase { init() { options = Options() options.maxBreadcrumbs = 2 - options.dsn = SentryWatchdogTerminationsTrackerTests.dsnAsString + options.dsn = SentryWatchdogTerminationTrackerTests.dsnAsString options.releaseName = TestData.appState.releaseName client = TestClient(options: options) @@ -31,11 +31,11 @@ class SentryWatchdogTerminationsTrackerTests: NotificationCenterTestCase { SentrySDK.setCurrentHub(hub) } - func getSut(usingRealFileManager: Bool) -> SentryWatchdogTerminationsTracker { + func getSut(usingRealFileManager: Bool) -> SentryWatchdogTerminationTracker { return getSut(fileManager: usingRealFileManager ? realFileManager : mockFileManager) } - func getSut(fileManager: SentryFileManager) -> SentryWatchdogTerminationsTracker { + func getSut(fileManager: SentryFileManager) -> SentryWatchdogTerminationTracker { let appStateManager = SentryAppStateManager( options: options, crashWrapper: crashWrapper, @@ -45,14 +45,14 @@ class SentryWatchdogTerminationsTrackerTests: NotificationCenterTestCase { dispatchQueueWrapper: self.dispatchQueue, notificationCenterWrapper: SentryNSNotificationCenterWrapper() ) - let logic = SentryWatchdogTerminationsLogic( + let logic = SentryWatchdogTerminationLogic( options: options, crashAdapter: crashWrapper, appStateManager: appStateManager ) - return SentryWatchdogTerminationsTracker( + return SentryWatchdogTerminationTracker( options: options, - watchdogTerminationsLogic: logic, + watchdogTerminationLogic: logic, appStateManager: appStateManager, dispatchQueueWrapper: dispatchQueue, fileManager: fileManager @@ -61,7 +61,7 @@ class SentryWatchdogTerminationsTrackerTests: NotificationCenterTestCase { } private var fixture: Fixture! - private var sut: SentryWatchdogTerminationsTracker! + private var sut: SentryWatchdogTerminationTracker! override func setUp() { super.setUp() @@ -246,10 +246,10 @@ class SentryWatchdogTerminationsTrackerTests: NotificationCenterTestCase { let breadcrumb = TestData.crumb - let sentryWatchdogTerminationsScopeObserver = SentryWatchdogTerminationsScopeObserver(maxBreadcrumbs: Int(fixture.options.maxBreadcrumbs), fileManager: fixture.mockFileManager) + let sentryWatchdogTerminationScopeObserver = SentryWatchdogTerminationScopeObserver(maxBreadcrumbs: Int(fixture.options.maxBreadcrumbs), fileManager: fixture.mockFileManager) for _ in 0..<3 { - sentryWatchdogTerminationsScopeObserver.addSerializedBreadcrumb(breadcrumb.serialize()) + sentryWatchdogTerminationScopeObserver.addSerializedBreadcrumb(breadcrumb.serialize()) } sut.start() diff --git a/Tests/SentryTests/SentrySDKTests.swift b/Tests/SentryTests/SentrySDKTests.swift index 05cc9dd03e5..c098067de4e 100644 --- a/Tests/SentryTests/SentrySDKTests.swift +++ b/Tests/SentryTests/SentrySDKTests.swift @@ -609,7 +609,7 @@ class SentrySDKTests: XCTestCase { options.dsn = SentrySDKTests.dsnAsString let fileManager = try! TestFileManager(options: options, andCurrentDateProvider: TestCurrentDateProvider()) - let observer = SentryWatchdogTerminationsScopeObserver(maxBreadcrumbs: 10, fileManager: fileManager) + let observer = SentryWatchdogTerminationScopeObserver(maxBreadcrumbs: 10, fileManager: fileManager) let serializedBreadcrumb = TestData.crumb.serialize() for _ in 0..<3 { diff --git a/Tests/SentryTests/SentryTests-Bridging-Header.h b/Tests/SentryTests/SentryTests-Bridging-Header.h index 002f34a6d47..2a2c1b99d3c 100644 --- a/Tests/SentryTests/SentryTests-Bridging-Header.h +++ b/Tests/SentryTests/SentryTests-Bridging-Header.h @@ -164,10 +164,10 @@ #import "SentryUserFeedback.h" #import "SentryViewHierarchy.h" #import "SentryViewHierarchyIntegration.h" -#import "SentryWatchdogTerminationsLogic.h" -#import "SentryWatchdogTerminationsScopeObserver.h" -#import "SentryWatchdogTerminationsTracker.h" -#import "SentryWatchdogTerminationsTrackingIntegration.h" +#import "SentryWatchdogTerminationLogic.h" +#import "SentryWatchdogTerminationScopeObserver.h" +#import "SentryWatchdogTerminationTracker.h" +#import "SentryWatchdogTerminationTrackingIntegration.h" #import "TestNSURLRequestBuilder.h" #import "TestSentryCrashWrapper.h" #import "TestSentrySpan.h"