Skip to content

Commit 32b9522

Browse files
committed
ref: Sentry envelope header to Swift
1 parent d38165b commit 32b9522

File tree

11 files changed

+214
-328
lines changed

11 files changed

+214
-328
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,6 @@
458458
7B8713B426415BAA006D6004 /* SentryAppStartTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8713B326415BAA006D6004 /* SentryAppStartTracker.m */; };
459459
7B87C916295ECFD700510C52 /* SentryMetricKitEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87C915295ECFD700510C52 /* SentryMetricKitEventTests.swift */; };
460460
7B883F49253D714C00879E62 /* SentryCrashUUIDConversion.c in Sources */ = {isa = PBXBuildFile; fileRef = 7B883F48253D714C00879E62 /* SentryCrashUUIDConversion.c */; };
461-
7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
462-
7B88F30024BC5A7D00ADF90A /* SentrySdkInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */; };
463461
7B88F30224BC5C6D00ADF90A /* SentrySdkInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */; };
464462
7B88F30424BC8E6500ADF90A /* SentrySerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */; };
465463
7B8CA85726DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */; };
@@ -1065,6 +1063,8 @@
10651063
FA67DD182DDBD4EA00896B02 /* UIImageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCED2DDBD4EA00896B02 /* UIImageHelper.swift */; };
10661064
FA67DD192DDBD4EA00896B02 /* SwizzleClassNameExclude.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCD52DDBD4EA00896B02 /* SwizzleClassNameExclude.swift */; };
10671065
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */; };
1066+
FA6FC0A62E0B694A00ED2669 /* SentryEnvelopeHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A52E0B694A00ED2669 /* SentryEnvelopeHeader.swift */; };
1067+
FA6FC0A82E0B69A200ED2669 /* SentrySdkInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6FC0A72E0B699F00ED2669 /* SentrySdkInfo.swift */; };
10681068
FA7206DF2E0B37850072FDD4 /* SentryProfileCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */; };
10691069
FA7206E12E0B37C80072FDD4 /* SentryProfileCollector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */; };
10701070
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
@@ -1636,8 +1636,6 @@
16361636
7B8713B326415BAA006D6004 /* SentryAppStartTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAppStartTracker.m; sourceTree = "<group>"; };
16371637
7B87C915295ECFD700510C52 /* SentryMetricKitEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMetricKitEventTests.swift; sourceTree = "<group>"; };
16381638
7B883F48253D714C00879E62 /* SentryCrashUUIDConversion.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SentryCrashUUIDConversion.c; sourceTree = "<group>"; };
1639-
7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySdkInfo.h; path = include/SentrySdkInfo.h; sourceTree = "<group>"; };
1640-
7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySdkInfo.m; sourceTree = "<group>"; };
16411639
7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfoTests.swift; sourceTree = "<group>"; };
16421640
7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationTests.swift; sourceTree = "<group>"; };
16431641
7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNetworkTrackerIntegrationTests.swift; sourceTree = "<group>"; };
@@ -2317,6 +2315,8 @@
23172315
FA67DCEF2DDBD4EA00896B02 /* URLSessionTaskHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelper.swift; sourceTree = "<group>"; };
23182316
FA67DCF22DDBD4EA00896B02 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = "<group>"; };
23192317
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkPackage.swift; sourceTree = "<group>"; };
2318+
FA6FC0A52E0B694A00ED2669 /* SentryEnvelopeHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeHeader.swift; sourceTree = "<group>"; };
2319+
FA6FC0A72E0B699F00ED2669 /* SentrySdkInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfo.swift; sourceTree = "<group>"; };
23202320
FA7206DE2E0B37780072FDD4 /* SentryProfileCollector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProfileCollector.h; sourceTree = "<group>"; };
23212321
FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfileCollector.mm; sourceTree = "<group>"; };
23222322
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
@@ -2458,6 +2458,7 @@
24582458
621D9F2D2B9B030E003D94DE /* Helper */ = {
24592459
isa = PBXGroup;
24602460
children = (
2461+
FA6FC0A72E0B699F00ED2669 /* SentrySdkInfo.swift */,
24612462
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */,
24622463
84B0E0062CD963F9007FB332 /* SentryIconography.swift */,
24632464
621F61F02BEA073A005E654F /* SentryEnabledFeaturesBuilder.swift */,
@@ -2572,8 +2573,6 @@
25722573
7B4E24FB251C97B400060D68 /* SentrySession.h */,
25732574
15E0A8F12411A45A00F044E3 /* SentrySession.m */,
25742575
7BE1E32624F7AE08009D3AD0 /* SentrySession+Private.h */,
2575-
7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */,
2576-
7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */,
25772576
7BFC169A2524995700FF6266 /* SentryMessage.h */,
25782577
7BFC16A025249A9D00FF6266 /* SentryMessage.m */,
25792578
7B4E375425822C4500059C93 /* SentryAttachment.h */,
@@ -4260,6 +4259,7 @@
42604259
children = (
42614260
FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */,
42624261
FA67DCC02DDBD4C800896B02 /* SentryLog+Configure.swift */,
4262+
FA6FC0A52E0B694A00ED2669 /* SentryEnvelopeHeader.swift */,
42634263
);
42644264
path = Tools;
42654265
sourceTree = "<group>";
@@ -4646,7 +4646,6 @@
46464646
63FE717720DA4C1100CDBAE8 /* SentryCrashReportWriter.h in Headers */,
46474647
84DEE86B2B686BD400A7BC17 /* SentrySamplerDecision.h in Headers */,
46484648
7B4E23BE251A2BD500060D68 /* SentryCrashIntegrationSessionHandler.h in Headers */,
4649-
7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */,
46504649
D4291A692DD61A3F00772088 /* SentryDispatchQueueProviderProtocol.h in Headers */,
46514650
7BCFBD672681C95000BC27D8 /* SentryScopeObserver.h in Headers */,
46524651
D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */,
@@ -5293,6 +5292,7 @@
52935292
7B3B473825D6CC7E00D01640 /* SentryNSError.m in Sources */,
52945293
621AE74D2C626C510012E730 /* SentryANRTrackerV2.m in Sources */,
52955294
84CFA4CA2C9DF884008DA5F4 /* SentryUserFeedbackWidget.swift in Sources */,
5295+
FA6FC0A62E0B694A00ED2669 /* SentryEnvelopeHeader.swift in Sources */,
52965296
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */,
52975297
F49D419E2DEA3D0600D9244E /* SentryCrashExceptionApplicationHelper.m in Sources */,
52985298
D8ACE3C82762187200F5A213 /* SentryFileIOTracker.m in Sources */,
@@ -5325,7 +5325,6 @@
53255325
7BA0C0482805600A003E0326 /* SentryTransportAdapter.m in Sources */,
53265326
63FE712920DA4C1000CDBAE8 /* SentryCrashCPU_arm.c in Sources */,
53275327
03F84D3427DD4191008FE43F /* SentryThreadMetadataCache.cpp in Sources */,
5328-
7B88F30024BC5A7D00ADF90A /* SentrySdkInfo.m in Sources */,
53295328
62862B1E2B1DDC35009B16E3 /* SentryDelayedFrame.m in Sources */,
53305329
84AC61D729F75A98009EEF61 /* SentryDispatchFactory.m in Sources */,
53315330
15360CD62432832400112302 /* SentryAutoSessionTrackingIntegration.m in Sources */,
@@ -5395,6 +5394,7 @@
53955394
63FE717320DA4C1100CDBAE8 /* SentryCrashC.c in Sources */,
53965395
6293F5752D422A95002BC3BD /* SentryStacktraceCodable.swift in Sources */,
53975396
63FE712120DA4C1000CDBAE8 /* SentryCrashSymbolicator.c in Sources */,
5397+
FA6FC0A82E0B69A200ED2669 /* SentrySdkInfo.swift in Sources */,
53985398
627C77892D50B6840055E966 /* SentryBreadcrumbCodable.swift in Sources */,
53995399
63FE70D720DA4C1000CDBAE8 /* SentryCrashMonitor_MachException.c in Sources */,
54005400
7B96572226830D2400C66E25 /* SentryScopeSyncC.c in Sources */,

Sources/Resources/Sentry.modulemap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ framework module Sentry {
2626
header "SentrySessionReplayIntegration.h"
2727
header "SentrySessionReplayIntegration-Hybrid.h"
2828

29-
header "SentrySdkInfo.h"
3029
header "SentryInternalSerializable.h"
3130

3231
export *

Sources/Sentry/SentryClient.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#import "SentryRandom.h"
3434
#import "SentrySDK+Private.h"
3535
#import "SentryScope+Private.h"
36-
#import "SentrySdkInfo.h"
3736
#import "SentrySerialization.h"
3837
#import "SentrySession.h"
3938
#import "SentryStacktraceBuilder.h"

Sources/Sentry/SentryEnvelope.m

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,13 @@
99
#import "SentryLog.h"
1010
#import "SentryMessage.h"
1111
#import "SentryMsgPackSerializer.h"
12-
#import "SentrySdkInfo.h"
1312
#import "SentrySerialization.h"
1413
#import "SentrySession.h"
1514
#import "SentrySwift.h"
1615
#import "SentryTransaction.h"
1716

1817
NS_ASSUME_NONNULL_BEGIN
1918

20-
@implementation SentryEnvelopeHeader
21-
22-
// id can be null if no event in the envelope or attachment related to event
23-
- (instancetype)initWithId:(SentryId *_Nullable)eventId
24-
{
25-
self = [self initWithId:eventId traceContext:nil];
26-
return self;
27-
}
28-
29-
- (instancetype)initWithId:(nullable SentryId *)eventId
30-
traceContext:(nullable SentryTraceContext *)traceContext
31-
{
32-
SentrySdkInfo *sdkInfo = [SentrySdkInfo global];
33-
self = [self initWithId:eventId sdkInfo:sdkInfo traceContext:traceContext];
34-
return self;
35-
}
36-
37-
- (instancetype)initWithId:(nullable SentryId *)eventId
38-
sdkInfo:(nullable SentrySdkInfo *)sdkInfo
39-
traceContext:(nullable SentryTraceContext *)traceContext
40-
{
41-
if (self = [super init]) {
42-
_eventId = eventId;
43-
_sdkInfo = sdkInfo;
44-
_traceContext = traceContext;
45-
}
46-
47-
return self;
48-
}
49-
50-
+ (instancetype)empty
51-
{
52-
return [[SentryEnvelopeHeader alloc] initWithId:nil traceContext:nil];
53-
}
54-
55-
@end
56-
5719
@implementation SentryEnvelopeItem
5820

5921
- (instancetype)initWithHeader:(SentryEnvelopeItemHeader *)header data:(NSData *)data

Sources/Sentry/SentrySdkInfo.m

Lines changed: 0 additions & 130 deletions
This file was deleted.

Sources/Sentry/SentrySerialization.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#import "SentryError.h"
88
#import "SentryLevelMapper.h"
99
#import "SentryLog.h"
10-
#import "SentrySdkInfo.h"
1110
#import "SentrySession.h"
1211
#import "SentrySwift.h"
1312
#import "SentryTraceContext.h"

Sources/Sentry/include/HybridPublic/SentryEnvelope.h

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@
44
# import "PrivatesHeader.h"
55
#endif
66

7-
#if COCOAPODS
8-
@class SentrySdkInfo;
9-
#else
10-
11-
# if __has_include(<Sentry/SentrySdkInfo.h>)
12-
# import <Sentry/SentrySdkInfo.h>
13-
# else
14-
# import "SentrySdkInfo.h"
15-
# endif
16-
17-
#endif
18-
197
@class SentryAttachment;
208
@class SentryEnvelopeItemHeader;
219
@class SentryEvent;
@@ -24,68 +12,10 @@
2412
@class SentrySession;
2513
@class SentryTraceContext;
2614
@class SentryUserFeedback;
15+
@class SentryEnvelopeHeader;
2716

2817
NS_ASSUME_NONNULL_BEGIN
2918

30-
@interface SentryEnvelopeHeader : NSObject
31-
SENTRY_NO_INIT
32-
33-
/**
34-
* Initializes an @c SentryEnvelopeHeader object with the specified eventId.
35-
* @note Sets the @c sdkInfo from @c SentryMeta.
36-
* @param eventId The identifier of the event. Can be nil if no event in the envelope or attachment
37-
* related to event.
38-
*/
39-
- (instancetype)initWithId:(SentryId *_Nullable)eventId;
40-
41-
/**
42-
* Initializes a @c SentryEnvelopeHeader object with the specified @c eventId and @c traceContext.
43-
* @param eventId The identifier of the event. Can be @c nil if no event in the envelope or
44-
* attachment related to event.
45-
* @param traceContext Current trace state.
46-
*/
47-
- (instancetype)initWithId:(nullable SentryId *)eventId
48-
traceContext:(nullable SentryTraceContext *)traceContext;
49-
50-
/**
51-
* Initializes a @c SentryEnvelopeHeader object with the specified @c eventId, @c skdInfo and
52-
* @c traceContext. It is recommended to use @c initWithId:traceContext: because it sets the
53-
* @c sdkInfo for you.
54-
* @param eventId The identifier of the event. Can be @c nil if no event in the envelope or
55-
* attachment related to event.
56-
* @param sdkInfo Describes the Sentry SDK. Can be @c nil for backwards compatibility. New
57-
* instances should always provide a version.
58-
* @param traceContext Current trace state.
59-
*/
60-
- (instancetype)initWithId:(nullable SentryId *)eventId
61-
sdkInfo:(nullable SentrySdkInfo *)sdkInfo
62-
traceContext:(nullable SentryTraceContext *)traceContext NS_DESIGNATED_INITIALIZER;
63-
64-
/**
65-
* The event identifier, if available.
66-
* An event id exist if the envelope contains an event of items within it are related. i.e
67-
* Attachments
68-
*/
69-
@property (nullable, nonatomic, readonly, copy) SentryId *eventId;
70-
71-
@property (nullable, nonatomic, readonly, copy) SentrySdkInfo *sdkInfo;
72-
73-
@property (nullable, nonatomic, readonly, copy) SentryTraceContext *traceContext;
74-
75-
/**
76-
* The timestamp when the event was sent from the SDK as string in RFC 3339 format. Used
77-
* for clock drift correction of the event timestamp. The time zone must be UTC.
78-
*
79-
* The timestamp should be generated as close as possible to the transmision of the event,
80-
* so that the delay between sending the envelope and receiving it on the server-side is
81-
* minimized.
82-
*/
83-
@property (nullable, nonatomic, copy) NSDate *sentAt;
84-
85-
+ (instancetype)empty;
86-
87-
@end
88-
8919
@interface SentryEnvelopeItem : NSObject
9020
SENTRY_NO_INIT
9121

0 commit comments

Comments
 (0)