Skip to content

Commit 17eb25b

Browse files
authored
Merge 617eea4 into 0b5fd21
2 parents 0b5fd21 + 617eea4 commit 17eb25b

26 files changed

+122
-54
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,22 @@ jobs:
112112
if: startsWith(github.ref, 'refs/heads/release/') == false
113113
steps:
114114
- uses: actions/checkout@v4
115-
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace && EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk watchos -destination 'generic/platform=watchOS'
115+
116+
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
117+
- run: set -o pipefail && NSUnbufferedIO=YES EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk watchos -destination 'generic/platform=watchOS' | tee raw-build-output-spm-watchos.log | xcbeautify
116118
shell: sh
117-
- run: EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk iphoneos -destination 'generic/platform=iphoneos'
119+
- run: set -o pipefail && NSUnbufferedIO=YES EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk iphoneos -destination 'generic/platform=iphoneos' | tee raw-build-output-spm-iphoneos.log | xcbeautify
118120
shell: sh
119121

122+
- name: Upload SPM Build Logs
123+
uses: actions/upload-artifact@v4
124+
if: ${{ failure() || cancelled() }}
125+
with:
126+
name: raw-build-output-spm
127+
path: |
128+
raw-build-output-spm-watchos.log
129+
raw-build-output-spm-iphoneos.log
130+
120131
build-v9:
121132
name: Build SDK v9
122133
runs-on: macos-15

Sources/Sentry/Processors/SentryWatchdogTerminationBreadcrumbProcessor.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#import "SentryWatchdogTerminationBreadcrumbProcessor.h"
22
#import "SentryFileManager.h"
3+
#import "SentryInternalDefines.h"
34
#import "SentryLogC.h"
45
#import "SentrySerialization.h"
56

@@ -44,7 +45,7 @@ - (void)addSerializedBreadcrumb:(NSDictionary *)crumb
4445
SENTRY_LOG_ERROR(@"Error serializing breadcrumb to JSON");
4546
return;
4647
}
47-
[self storeBreadcrumb:jsonData];
48+
[self storeBreadcrumb:SENTRY_UNWRAP_NULLABLE(NSData, jsonData)];
4849
}
4950

5051
- (void)clear

Sources/Sentry/SentryBinaryImageCache.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#import "SentryDefaultObjCRuntimeWrapper.h"
55
#import "SentryDependencyContainer.h"
66
#import "SentryInAppLogic.h"
7+
#import "SentryInternalDefines.h"
78
#import "SentryLogC.h"
89
#import "SentrySDK+Private.h"
910
#import "SentrySwift.h"
@@ -176,7 +177,7 @@ - (NSInteger)indexOfImage:(uint64_t)address
176177
- (NSArray<SentryBinaryImageInfo *> *)getAllBinaryImages
177178
{
178179
@synchronized(self) {
179-
return _cache.copy;
180+
return SENTRY_UNWRAP_NULLABLE(NSArray<SentryBinaryImageInfo *>, _cache.copy);
180181
}
181182
}
182183

Sources/Sentry/SentryBreadcrumb.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#import "SentryBreadcrumb.h"
22
#import "SentryBreadcrumb+Private.h"
33
#import "SentryDateUtils.h"
4+
#import "SentryInternalDefines.h"
45
#import "SentryLevelMapper.h"
56
#import "SentryNSDictionarySanitize.h"
67
#import "SentrySwift.h"
@@ -75,7 +76,7 @@ - (BOOL)isEqual:(id _Nullable)other
7576
if (!other || ![[other class] isEqual:[self class]])
7677
return NO;
7778

78-
return [self isEqualToBreadcrumb:other];
79+
return [self isEqualToBreadcrumb:SENTRY_UNWRAP_NULLABLE(SentryBreadcrumb, other)];
7980
}
8081

8182
- (BOOL)isEqualToBreadcrumb:(SentryBreadcrumb *)breadcrumb

Sources/Sentry/SentryBreadcrumbTracker.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,14 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller
316316

317317
if (controller.presentingViewController != nil) {
318318
info[@"presentingViewController"] =
319-
[SwiftDescriptor getViewControllerClassName:controller.presentingViewController];
319+
[SwiftDescriptor getViewControllerClassName:SENTRY_UNWRAP_NULLABLE(UIViewController,
320+
controller.presentingViewController)];
320321
}
321322

322323
if (controller.parentViewController != nil) {
323324
info[@"parentViewController"] =
324-
[SwiftDescriptor getViewControllerClassName:controller.parentViewController];
325+
[SwiftDescriptor getViewControllerClassName:SENTRY_UNWRAP_NULLABLE(UIViewController,
326+
controller.parentViewController)];
325327
}
326328

327329
if (controller.view.window != nil) {

Sources/Sentry/SentryCoreDataTracker.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ - (NSString *)descriptionFromRequest:(NSFetchRequest *)request
204204

205205
if (request.predicate) {
206206
[result appendFormat:@" WHERE %@",
207-
[predicateDescriptor predicateDescription:request.predicate]];
207+
[predicateDescriptor
208+
predicateDescription:SENTRY_UNWRAP_NULLABLE(NSPredicate, request.predicate)]];
208209
}
209210

210211
if (request.sortDescriptors.count > 0) {

Sources/Sentry/SentryCrashIntegrationSessionHandler.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#import "SentryDependencyContainer.h"
55
#import "SentryFileManager.h"
66
#import "SentryHub.h"
7+
#import "SentryInternalDefines.h"
78
#import "SentryLogC.h"
89
#import "SentrySDK+Private.h"
910
#import "SentrySession.h"
@@ -81,7 +82,8 @@ - (void)endCurrentSessionIfRequired
8182
return;
8283
}
8384

84-
[session endSessionAbnormalWithTimestamp:appHangEvent.timestamp];
85+
[session
86+
endSessionAbnormalWithTimestamp:SENTRY_UNWRAP_NULLABLE(NSDate, appHangEvent).timestamp];
8587
[fileManager storeAbnormalSession:session];
8688
[fileManager deleteCurrentSession];
8789
}

Sources/Sentry/SentryDateUtil.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "SentryDateUtil.h"
2+
#import "SentryInternalDefines.h"
23
#import "SentrySwift.h"
34

45
NS_ASSUME_NONNULL_BEGIN
@@ -24,7 +25,8 @@ - (BOOL)isInFuture:(NSDate *_Nullable)date
2425
if (date == nil)
2526
return NO;
2627

27-
NSComparisonResult result = [[self.currentDateProvider date] compare:date];
28+
NSComparisonResult result =
29+
[[self.currentDateProvider date] compare:SENTRY_UNWRAP_NULLABLE(NSDate, date)];
2830
return result == NSOrderedAscending;
2931
}
3032

@@ -37,7 +39,8 @@ + (NSDate *_Nullable)getMaximumDate:(NSDate *_Nullable)first andOther:(NSDate *_
3739
if (second == nil)
3840
return first;
3941

40-
NSComparisonResult result = [first compare:second];
42+
NSComparisonResult result =
43+
[SENTRY_UNWRAP_NULLABLE(NSDate, first) compare:SENTRY_UNWRAP_NULLABLE(NSDate, second)];
4144
if (result == NSOrderedDescending) {
4245
return first;
4346
} else {

Sources/Sentry/SentryDebugImageProvider.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (void)extractDebugImageAddressFromFrames:(NSArray<SentryFrame *> *)frames
6767
{
6868
for (SentryFrame *frame in frames) {
6969
if (frame.imageAddress) {
70-
[set addObject:frame.imageAddress];
70+
[set addObject:SENTRY_UNWRAP_NULLABLE(NSString, frame.imageAddress)];
7171
}
7272
}
7373
}
@@ -85,7 +85,8 @@ - (void)extractDebugImageAddressFromFrames:(NSArray<SentryFrame *> *)frames
8585
# pragma clang diagnostic pop
8686

8787
for (SentryDebugMeta *sourceImage in binaryImages) {
88-
if ([addresses containsObject:sourceImage.imageAddress]) {
88+
if (sourceImage.imageAddress &&
89+
[addresses containsObject:SENTRY_UNWRAP_NULLABLE(NSString, sourceImage.imageAddress)]) {
8990
[result addObject:sourceImage];
9091
}
9192
}

Sources/Sentry/SentryDefaultRateLimits.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#import "SentryConcurrentRateLimitsDictionary.h"
33
#import "SentryDataCategoryMapper.h"
44
#import "SentryDateUtil.h"
5+
#import "SentryInternalDefines.h"
56
#import "SentryLogC.h"
67
#import "SentryRateLimitParser.h"
78
#import "SentryRetryAfterHeaderParser.h"
@@ -61,7 +62,8 @@ - (void)update:(NSHTTPURLResponse *)response
6162
SentryDataCategory category
6263
= sentryDataCategoryForNSUInteger(categoryAsNumber.unsignedIntegerValue);
6364

64-
[self updateRateLimit:category withDate:limits[categoryAsNumber]];
65+
[self updateRateLimit:category
66+
withDate:SENTRY_UNWRAP_NULLABLE(NSDate, limits[categoryAsNumber])];
6567
}
6668
} else if (response.statusCode == 429) {
6769
NSDate *retryAfterHeaderDate =

0 commit comments

Comments
 (0)