Skip to content
Merged
32 changes: 16 additions & 16 deletions Sentry.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Sources/Sentry/SentryClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#import "SentryTransportFactory.h"
#import "SentryUseNSExceptionCallstackWrapper.h"
#import "SentryUser.h"
#import "SentryWatchdogTerminationTracker.h"

#if SENTRY_HAS_UIKIT
# import <UIKit/UIKit.h>
Expand Down Expand Up @@ -943,7 +942,7 @@ - (BOOL)isWatchdogTermination:(SentryEvent *)event isFatalEvent:(BOOL)isFatalEve

SentryException *exception = event.exceptions[0];
return exception.mechanism != nil &&
[exception.mechanism.type isEqualToString:SentryWatchdogTerminationMechanismType];
[exception.mechanism.type isEqualToString:SentryWatchdogTerminationConstants.MechanismType];
}

- (void)applyCultureContextToEvent:(SentryEvent *)event
Expand Down
1 change: 0 additions & 1 deletion Sources/Sentry/SentryCrashIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#import "SentrySpan+Private.h"
#import "SentrySwift.h"
#import "SentryTracer.h"
#import "SentryWatchdogTerminationLogic.h"
#import <SentryClient+Private.h>
#import <SentryCrashScopeObserver.h>
#import <SentryLogC.h>
Expand Down
1 change: 0 additions & 1 deletion Sources/Sentry/SentryCrashIntegrationSessionHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#import "SentryLogC.h"
#import "SentrySDK+Private.h"
#import "SentrySwift.h"
#import "SentryWatchdogTerminationLogic.h"

@interface SentryCrashIntegrationSessionHandler ()

Expand Down
117 changes: 0 additions & 117 deletions Sources/Sentry/SentryWatchdogTerminationLogic.m

This file was deleted.

133 changes: 0 additions & 133 deletions Sources/Sentry/SentryWatchdogTerminationTracker.m

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# import <SentryScope+PrivateSwift.h>
# import <SentrySwift.h>
# import <SentryWatchdogTerminationBreadcrumbProcessor.h>
# import <SentryWatchdogTerminationLogic.h>
# import <SentryWatchdogTerminationTracker.h>
NS_ASSUME_NONNULL_BEGIN

@interface SentryWatchdogTerminationTrackingIntegration () <SentryANRTrackerDelegate>
Expand Down
26 changes: 0 additions & 26 deletions Sources/Sentry/include/SentryWatchdogTerminationLogic.h

This file was deleted.

38 changes: 0 additions & 38 deletions Sources/Sentry/include/SentryWatchdogTerminationTracker.h

This file was deleted.

32 changes: 32 additions & 0 deletions Sources/Swift/AppState/SentryAppStateManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,38 @@ import UIKit
}

#if (os(iOS) || os(tvOS) || os(visionOS)) && !SENTRY_NO_UIKIT

#if SENTRY_TEST || SENTRY_TEST_CI
/// Test-only initializer to allow injecting a custom `buildCurrentAppState` closure for testing
/// scenarios where the current app state needs specific values (e.g., nil vendorId).
init(releaseName: String?, crashWrapper: SentryCrashWrapper, fileManager: SentryFileManager?, sysctlWrapper: SentrySysctl, customBuildCurrentAppState: @escaping () -> SentryAppState) {
self.releaseName = releaseName
self.crashWrapper = crashWrapper
self.fileManager = fileManager
let lock = NSRecursiveLock()
_buildCurrentAppState = customBuildCurrentAppState
let updateAppState: (@escaping (SentryAppState) -> Void) -> Void = { block in
lock.synchronized {
let appState = fileManager?.readAppState()
if let appState {
block(appState)
fileManager?.store(appState)
}
}
}
_updateAppState = updateAppState
helper = SentryDefaultAppStateManager(storeCurrent: {
fileManager?.store(customBuildCurrentAppState())
}, updateTerminated: {
updateAppState { $0.wasTerminated = true }
}, updateSDKNotRunning: {
updateAppState { $0.isSDKRunning = false }
}, updateActive: { active in
updateAppState { $0.isActive = active }
})
}
#endif

var startCount: Int {
helper.startCount
}
Expand Down
Loading
Loading