Skip to content

Commit d4ac58b

Browse files
authored
Merge b005648 into 80538ca
2 parents 80538ca + b005648 commit d4ac58b

17 files changed

+357
-658
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@
4848
0A9BF4E928A125390068D266 /* TestSentryViewHierarchyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9BF4E628A123270068D266 /* TestSentryViewHierarchyProvider.swift */; };
4949
0A9BF4EB28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9BF4EA28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift */; };
5050
0A9E917128DC7E7000FB4182 /* SentryInternalCDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */; };
51-
0AAE201E28ED9B9400D0CD80 /* SentryReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */; };
52-
0AAE202128ED9BCC00D0CD80 /* SentryReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */; };
5351
0ADC33F128D9BE940078D980 /* TestSentryUIDeviceWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ADC33EF28D9BE690078D980 /* TestSentryUIDeviceWrapper.swift */; };
54-
0AE455AD28F584D2006680E5 /* SentryReachabilityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */; };
5552
15360CCF2432777500112302 /* SentrySessionTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 15360CCE2432777400112302 /* SentrySessionTracker.m */; };
5653
15360CD2243277A000112302 /* SentrySessionTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 15360CD12432779F00112302 /* SentrySessionTracker.h */; };
5754
15360CD62432832400112302 /* SentryAutoSessionTrackingIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = 15360CD52432832400112302 /* SentryAutoSessionTrackingIntegration.m */; };
@@ -1001,6 +998,7 @@
1001998
F48F75712E5FA630009D4E7D /* SentryBinaryImageCacheCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = F48F75702E5FA630009D4E7D /* SentryBinaryImageCacheCallbacks.m */; };
1002999
F48F75732E5FA649009D4E7D /* SentryBinaryImageCacheCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = F48F75722E5FA649009D4E7D /* SentryBinaryImageCacheCallbacks.h */; };
10031000
F48F767C2E60B555009D4E7D /* SentryNSTimerFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48F767B2E60B555009D4E7D /* SentryNSTimerFactory.swift */; };
1001+
F48F78692E61DE28009D4E7D /* SentryReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48F78682E61DE28009D4E7D /* SentryReachability.swift */; };
10041002
F49236EB2E5E4B2F00663673 /* SentryBinaryImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49236EA2E5E4B2F00663673 /* SentryBinaryImageCache.swift */; };
10051003
F49D41982DEA27AF00D9244E /* SentryUseNSExceptionCallstackWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49D41972DEA27AF00D9244E /* SentryUseNSExceptionCallstackWrapperTests.swift */; };
10061004
F49D419A2DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49D41992DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift */; };
@@ -1280,10 +1278,7 @@
12801278
0A9BF4E628A123270068D266 /* TestSentryViewHierarchyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryViewHierarchyProvider.swift; sourceTree = "<group>"; };
12811279
0A9BF4EA28A127120068D266 /* SentryViewHierarchyIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryViewHierarchyIntegrationTests.swift; sourceTree = "<group>"; };
12821280
0A9E917028DC7E7000FB4182 /* SentryInternalCDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryInternalCDefines.h; path = include/SentryInternalCDefines.h; sourceTree = "<group>"; };
1283-
0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryReachability.m; sourceTree = "<group>"; };
1284-
0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryReachability.h; path = include/SentryReachability.h; sourceTree = "<group>"; };
12851281
0ADC33EF28D9BE690078D980 /* TestSentryUIDeviceWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryUIDeviceWrapper.swift; sourceTree = "<group>"; };
1286-
0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryReachabilityTests.m; sourceTree = "<group>"; };
12871282
15360CCE2432777400112302 /* SentrySessionTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentrySessionTracker.m; sourceTree = "<group>"; };
12881283
15360CD12432779F00112302 /* SentrySessionTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySessionTracker.h; path = include/SentrySessionTracker.h; sourceTree = "<group>"; };
12891284
15360CD52432832400112302 /* SentryAutoSessionTrackingIntegration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAutoSessionTrackingIntegration.m; sourceTree = "<group>"; };
@@ -2341,6 +2336,7 @@
23412336
F48F75702E5FA630009D4E7D /* SentryBinaryImageCacheCallbacks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryBinaryImageCacheCallbacks.m; sourceTree = "<group>"; };
23422337
F48F75722E5FA649009D4E7D /* SentryBinaryImageCacheCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryBinaryImageCacheCallbacks.h; path = ../../Sentry/include/SentryBinaryImageCacheCallbacks.h; sourceTree = "<group>"; };
23432338
F48F767B2E60B555009D4E7D /* SentryNSTimerFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNSTimerFactory.swift; sourceTree = "<group>"; };
2339+
F48F78682E61DE28009D4E7D /* SentryReachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryReachability.swift; sourceTree = "<group>"; };
23442340
F49236EA2E5E4B2F00663673 /* SentryBinaryImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBinaryImageCache.swift; sourceTree = "<group>"; };
23452341
F49D41972DEA27AF00D9244E /* SentryUseNSExceptionCallstackWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUseNSExceptionCallstackWrapperTests.swift; sourceTree = "<group>"; };
23462342
F49D41992DEA2FB000D9244E /* SentryCrashExceptionApplicationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashExceptionApplicationTests.swift; sourceTree = "<group>"; };
@@ -2671,8 +2667,6 @@
26712667
638DC99F1EBC6B6400A66E41 /* SentryRequestOperation.m */,
26722668
7BDB03B6251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h */,
26732669
7BDB03BA2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m */,
2674-
0AAE202028ED9BCC00D0CD80 /* SentryReachability.h */,
2675-
0AAE201D28ED9B9400D0CD80 /* SentryReachability.m */,
26762670
);
26772671
name = Networking;
26782672
sourceTree = "<group>";
@@ -3519,7 +3513,6 @@
35193513
7B01CE3C271993AB00B5AF31 /* SentryTransportFactoryTests.swift */,
35203514
7B5CAF7C27F5AD0600ED0DB6 /* TestNSURLRequestBuilder.h */,
35213515
7B5CAF7D27F5AD3500ED0DB6 /* TestNSURLRequestBuilder.m */,
3522-
0AE455AC28F584D2006680E5 /* SentryReachabilityTests.m */,
35233516
629690522AD3E060000185FA /* SentryReachabilitySwiftTests.swift */,
35243517
0A9415B928F96CAC006A5DD1 /* TestSentryReachability.swift */,
35253518
D4FC68192DD63465001B74FF /* SentryDispatchQueueWrapperTests.m */,
@@ -4709,6 +4702,7 @@
47094702
F429D3992E85360F00DBF387 /* RetryAfterHeaderParser.swift */,
47104703
F429D37D2E8532A300DBF387 /* HttpDateParser.swift */,
47114704
F429D3A82E8562EF00DBF387 /* RateLimitParser.swift */,
4705+
F48F78682E61DE28009D4E7D /* SentryReachability.swift */,
47124706
);
47134707
path = Networking;
47144708
sourceTree = "<group>";
@@ -4988,7 +4982,6 @@
49884982
D8739D172BEEA33F007D2F66 /* SentryLevelHelper.h in Headers */,
49894983
8E4A037825F6F52100000D77 /* SentrySampleDecision.h in Headers */,
49904984
63FE717920DA4C1100CDBAE8 /* SentryCrashReportStore.h in Headers */,
4991-
0AAE202128ED9BCC00D0CD80 /* SentryReachability.h in Headers */,
49924985
A839D89824864B80003B7AFD /* SentrySystemEventBreadcrumbs.h in Headers */,
49934986
7B14089624878F090035403D /* SentryCrashStackEntryMapper.h in Headers */,
49944987
63FE714920DA4C1100CDBAE8 /* SentryCrashStackCursor_Backtrace.h in Headers */,
@@ -5582,6 +5575,7 @@
55825575
7B8713B426415BAA006D6004 /* SentryAppStartTracker.m in Sources */,
55835576
7BDB03BB2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m in Sources */,
55845577
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */,
5578+
F48F78692E61DE28009D4E7D /* SentryReachability.swift in Sources */,
55855579
D8739D142BEE5049007D2F66 /* SentryRRWebSpanEvent.swift in Sources */,
55865580
FAAB2F972E4D345800FE8B7E /* SentryUIDeviceWrapper.swift in Sources */,
55875581
7B6C5EDE264E8DF00010D138 /* SentryFramesTracker.m in Sources */,
@@ -5740,7 +5734,6 @@
57405734
7DB3A687238EA75E00A2D442 /* SentryHttpTransport.m in Sources */,
57415735
63FE70D520DA4C1000CDBAE8 /* SentryCrashMonitor_NSException.m in Sources */,
57425736
62F70E952D423BCD00634054 /* SentryMechanismCodable.swift in Sources */,
5743-
0AAE201E28ED9B9400D0CD80 /* SentryReachability.m in Sources */,
57445737
6283085F2D50AA8C00EAEF77 /* SentryMessage.swift in Sources */,
57455738
7BC63F0A28081288009D9E37 /* SentrySwizzleWrapper.m in Sources */,
57465739
6276350C2D59FACC00F7CEF6 /* SentryEventDecoder.swift in Sources */,
@@ -6231,7 +6224,6 @@
62316224
D808FB92281BF6EC009A2A33 /* SentryUIEventTrackingIntegrationTests.swift in Sources */,
62326225
7BC6EC04255C235F0059822A /* SentryFrameTests.swift in Sources */,
62336226
D82DD1CD2BEEB1A0001AB556 /* SentrySRDefaultBreadcrumbConverterTests.swift in Sources */,
6234-
0AE455AD28F584D2006680E5 /* SentryReachabilityTests.m in Sources */,
62356227
63FE720420DA66EC00CDBAE8 /* SentryCrashString_Tests.m in Sources */,
62366228
62872B632BA1B86100A4FA7D /* LocksTests.swift in Sources */,
62376229
849AC40029E0C1FF00889C16 /* SentryFormatterTests.swift in Sources */,

SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#import "SentryLogC.h"
4141
#import "SentryNetworkTracker.h"
4242
#import "SentryPerformanceTracker+Testing.h"
43-
#import "SentryReachability.h"
4443
#import "SentrySDK+Private.h"
4544
#import "SentrySDKInternal+Tests.h"
4645
#import "SentryScopeSyncC.h"

Sources/Sentry/Public/SentryDefines.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@
6565
-(instancetype)init NS_UNAVAILABLE; \
6666
+(instancetype) new NS_UNAVAILABLE;
6767

68-
#if !TARGET_OS_WATCH && !(TARGET_OS_VISION && SENTRY_NO_UIKIT == 1)
69-
# define SENTRY_HAS_REACHABILITY 1
70-
#else
71-
# define SENTRY_HAS_REACHABILITY 0
72-
#endif
73-
7468
@class SentryBreadcrumb;
7569
@class SentryEvent;
7670
@class SentrySamplingContext;

Sources/Sentry/SentryBreadcrumbTracker.m

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#import "SentryHub.h"
88
#import "SentryInternalDefines.h"
99
#import "SentryLogC.h"
10-
#import "SentryReachability.h"
1110
#import "SentryScope.h"
1211
#import "SentrySwift.h"
1312
#import "SentrySwizzle.h"
@@ -26,10 +25,7 @@
2625
static NSString *const SentryBreadcrumbTrackerSwizzleSendAction
2726
= @"SentryBreadcrumbTrackerSwizzleSendAction";
2827

29-
@interface SentryBreadcrumbTracker ()
30-
#if SENTRY_HAS_REACHABILITY
31-
<SentryReachabilityObserver>
32-
#endif // !TARGET_OS_WATCH
28+
@interface SentryBreadcrumbTracker () <SentryReachabilityObserver>
3329

3430
@property (nonatomic, weak) id<SentryBreadcrumbDelegate> delegate;
3531

@@ -39,12 +35,10 @@ @implementation SentryBreadcrumbTracker {
3935
BOOL _reportAccessibilityIdentifier;
4036
}
4137

42-
#if SENTRY_HAS_REACHABILITY
4338
- (void)dealloc
4439
{
4540
[SentryDependencyContainer.sharedInstance.reachability removeObserver:self];
4641
}
47-
#endif // !TARGET_OS_WATCH
4842

4943
- (instancetype)initReportAccessibilityIdentifier:(BOOL)report
5044
{
@@ -59,9 +53,7 @@ - (void)startWithDelegate:(id<SentryBreadcrumbDelegate>)delegate
5953
_delegate = delegate;
6054
[self addEnabledCrumb];
6155
[self trackApplicationNotifications];
62-
#if SENTRY_HAS_REACHABILITY
6356
[self trackNetworkConnectivityChanges];
64-
#endif // !TARGET_OS_WATCH
6557
}
6658

6759
#if SENTRY_HAS_UIKIT
@@ -81,9 +73,7 @@ - (void)stop
8173
removeSwizzleSendActionForKey:SentryBreadcrumbTrackerSwizzleSendAction];
8274
#endif // SENTRY_HAS_UIKIT
8375
_delegate = nil;
84-
#if SENTRY_HAS_REACHABILITY
8576
[self stopTrackNetworkConnectivityChanges];
86-
#endif // !TARGET_OS_WATCH
8777
}
8878

8979
- (void)trackApplicationNotifications
@@ -143,7 +133,6 @@ - (void)trackApplicationNotifications
143133
#endif // SENTRY_HAS_UIKIT || SENTRY_TARGET_MACOS_HAS_UI
144134
}
145135

146-
#if SENTRY_HAS_REACHABILITY
147136
- (void)trackNetworkConnectivityChanges
148137
{
149138
[SentryDependencyContainer.sharedInstance.reachability addObserver:self];
@@ -163,8 +152,6 @@ - (void)connectivityChanged:(BOOL)connected typeDescription:(nonnull NSString *)
163152
[self.delegate addBreadcrumb:crumb];
164153
}
165154

166-
#endif // !TARGET_OS_WATCH
167-
168155
- (void)addBreadcrumbWithType:(NSString *)type
169156
withCategory:(NSString *)category
170157
withLevel:(SentryLevel)level

Sources/Sentry/SentryDependencyContainer.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
# import <SentryWatchdogTerminationBreadcrumbProcessor.h>
3030
#endif // SENTRY_HAS_UIKIT
3131

32-
#if !TARGET_OS_WATCH
33-
# import "SentryReachability.h"
34-
#endif // !TARGET_OS_WATCH
35-
3632
/**
3733
* Macro for implementing lazy initialization with a double-checked lock. The double-checked lock
3834
* speeds up the dependency retrieval by around 5%, so it's worth having it. Measured with
@@ -123,9 +119,7 @@ + (instancetype)sharedInstance
123119
+ (void)reset
124120
{
125121
@synchronized(sentryDependencyContainerInstanceLock) {
126-
#if SENTRY_HAS_REACHABILITY
127122
[instance->_reachability removeAllObservers];
128-
#endif // !TARGET_OS_WATCH
129123

130124
#if SENTRY_HAS_UIKIT
131125
[instance->_framesTracker stop];
@@ -189,9 +183,7 @@ - (instancetype)init
189183
andRateLimitParser:rateLimitParser
190184
currentDateProvider:_dateProvider];
191185

192-
#if SENTRY_HAS_REACHABILITY
193186
_reachability = [[SentryReachability alloc] init];
194-
#endif // !SENTRY_HAS_REACHABILITY
195187

196188
isInitialializingDependencyContainer = NO;
197189
}

Sources/Sentry/SentryHttpTransport.m

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,7 @@
1414
#import "SentrySerialization.h"
1515
#import "SentrySwift.h"
1616

17-
#if !TARGET_OS_WATCH
18-
# import "SentryReachability.h"
19-
#endif // !TARGET_OS_WATCH
20-
21-
@interface SentryHttpTransport ()
22-
#if SENTRY_HAS_REACHABILITY
23-
<SentryReachabilityObserver>
24-
#endif // !TARGET_OS_WATCH
17+
@interface SentryHttpTransport () <SentryReachabilityObserver>
2518

2619
@property (nonatomic, readonly) NSTimeInterval cachedEnvelopeSendDelay;
2720
@property (nonatomic, strong) SentryFileManager *fileManager;
@@ -99,14 +92,11 @@ - (id)initWithDsn:(SentryDsn *)dsn
9992

10093
[self sendAllCachedEnvelopes];
10194

102-
#if SENTRY_HAS_REACHABILITY
10395
[SentryDependencyContainer.sharedInstance.reachability addObserver:self];
104-
#endif // !TARGET_OS_WATCH
10596
}
10697
return self;
10798
}
10899

109-
#if SENTRY_HAS_REACHABILITY
110100
- (void)connectivityChanged:(BOOL)connected typeDescription:(nonnull NSString *)typeDescription
111101
{
112102
if (connected) {
@@ -121,7 +111,6 @@ - (void)dealloc
121111
{
122112
[SentryDependencyContainer.sharedInstance.reachability removeObserver:self];
123113
}
124-
#endif // !TARGET_OS_WATCH
125114

126115
- (void)sendEnvelope:(SentryEnvelope *)envelope
127116
{

0 commit comments

Comments
 (0)