Skip to content

Commit 81f011c

Browse files
committed
Envelope header swift
1 parent 95cfd20 commit 81f011c

File tree

10 files changed

+177
-332
lines changed

10 files changed

+177
-332
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@
465465
7B8713B426415BAA006D6004 /* SentryAppStartTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8713B326415BAA006D6004 /* SentryAppStartTracker.m */; };
466466
7B87C916295ECFD700510C52 /* SentryMetricKitEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B87C915295ECFD700510C52 /* SentryMetricKitEventTests.swift */; };
467467
7B883F49253D714C00879E62 /* SentryCrashUUIDConversion.c in Sources */ = {isa = PBXBuildFile; fileRef = 7B883F48253D714C00879E62 /* SentryCrashUUIDConversion.c */; };
468-
7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
469-
7B88F30024BC5A7D00ADF90A /* SentrySdkInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */; };
470468
7B88F30224BC5C6D00ADF90A /* SentrySdkInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */; };
471469
7B88F30424BC8E6500ADF90A /* SentrySerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */; };
472470
7B8CA85726DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */; };
@@ -1068,6 +1066,7 @@
10681066
FA67DD182DDBD4EA00896B02 /* UIImageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCED2DDBD4EA00896B02 /* UIImageHelper.swift */; };
10691067
FA67DD192DDBD4EA00896B02 /* SwizzleClassNameExclude.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA67DCD52DDBD4EA00896B02 /* SwizzleClassNameExclude.swift */; };
10701068
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
1069+
FA90FAA62E065A47008CAAE8 /* SentryEnvelopeHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAA52E065A43008CAAE8 /* SentryEnvelopeHeader.swift */; };
10711070
FAEC270E2DF3526000878871 /* SentryUserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */; };
10721071
FAEC273D2DF3933A00878871 /* NSData+Unzip.m in Sources */ = {isa = PBXBuildFile; fileRef = FAEC273C2DF3933200878871 /* NSData+Unzip.m */; };
10731072
/* End PBXBuildFile section */
@@ -1639,8 +1638,6 @@
16391638
7B8713B326415BAA006D6004 /* SentryAppStartTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAppStartTracker.m; sourceTree = "<group>"; };
16401639
7B87C915295ECFD700510C52 /* SentryMetricKitEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMetricKitEventTests.swift; sourceTree = "<group>"; };
16411640
7B883F48253D714C00879E62 /* SentryCrashUUIDConversion.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SentryCrashUUIDConversion.c; sourceTree = "<group>"; };
1642-
7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySdkInfo.h; path = include/SentrySdkInfo.h; sourceTree = "<group>"; };
1643-
7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySdkInfo.m; sourceTree = "<group>"; };
16441641
7B88F30124BC5C6D00ADF90A /* SentrySdkInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySdkInfoTests.swift; sourceTree = "<group>"; };
16451642
7B88F30324BC8E6500ADF90A /* SentrySerializationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySerializationTests.swift; sourceTree = "<group>"; };
16461643
7B8CA85626DD4E6200DD872C /* SentryNetworkTrackerIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNetworkTrackerIntegrationTests.swift; sourceTree = "<group>"; };
@@ -2316,6 +2313,7 @@
23162313
FA67DCEF2DDBD4EA00896B02 /* URLSessionTaskHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelper.swift; sourceTree = "<group>"; };
23172314
FA67DCF22DDBD4EA00896B02 /* SwiftDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDescriptor.swift; sourceTree = "<group>"; };
23182315
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
2316+
FA90FAA52E065A43008CAAE8 /* SentryEnvelopeHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeHeader.swift; sourceTree = "<group>"; };
23192317
FAEC270D2DF3526000878871 /* SentryUserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUserFeedback.swift; sourceTree = "<group>"; };
23202318
FAEC273C2DF3933200878871 /* NSData+Unzip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+Unzip.m"; sourceTree = "<group>"; };
23212319
FAEC273E2DF393E000878871 /* NSData+Unzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+Unzip.h"; sourceTree = "<group>"; };
@@ -2565,8 +2563,6 @@
25652563
7B4E24FB251C97B400060D68 /* SentrySession.h */,
25662564
15E0A8F12411A45A00F044E3 /* SentrySession.m */,
25672565
7BE1E32624F7AE08009D3AD0 /* SentrySession+Private.h */,
2568-
7B88F2FD24BC5A4C00ADF90A /* SentrySdkInfo.h */,
2569-
7B88F2FF24BC5A7D00ADF90A /* SentrySdkInfo.m */,
25702566
7BFC169A2524995700FF6266 /* SentryMessage.h */,
25712567
7BFC16A025249A9D00FF6266 /* SentryMessage.m */,
25722568
7B4E375425822C4500059C93 /* SentryAttachment.h */,
@@ -4248,6 +4244,7 @@
42484244
D856272A2A374A6800FB8062 /* Tools */ = {
42494245
isa = PBXGroup;
42504246
children = (
4247+
FA90FAA52E065A43008CAAE8 /* SentryEnvelopeHeader.swift */,
42514248
FA67DCC02DDBD4C800896B02 /* SentryLog+Configure.swift */,
42524249
);
42534250
path = Tools;
@@ -4635,7 +4632,6 @@
46354632
63FE717720DA4C1100CDBAE8 /* SentryCrashReportWriter.h in Headers */,
46364633
84DEE86B2B686BD400A7BC17 /* SentrySamplerDecision.h in Headers */,
46374634
7B4E23BE251A2BD500060D68 /* SentryCrashIntegrationSessionHandler.h in Headers */,
4638-
7B88F2FE24BC5A4C00ADF90A /* SentrySdkInfo.h in Headers */,
46394635
D4291A692DD61A3F00772088 /* SentryDispatchQueueProviderProtocol.h in Headers */,
46404636
7BCFBD672681C95000BC27D8 /* SentryScopeObserver.h in Headers */,
46414637
D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */,
@@ -5297,6 +5293,7 @@
52975293
15E0A8ED240F2CB000F044E3 /* SentrySerialization.m in Sources */,
52985294
7BC85235245880AE005A70F0 /* SentryDataCategoryMapper.m in Sources */,
52995295
7B7A30C824B48389005A4C6E /* SentryCrashWrapper.m in Sources */,
5296+
FA90FAA62E065A47008CAAE8 /* SentryEnvelopeHeader.swift in Sources */,
53005297
D8ACE3C92762187200F5A213 /* SentryFileIOTrackingIntegration.m in Sources */,
53015298
620078742D38F0DF0022CB67 /* SentryCodable.swift in Sources */,
53025299
F45243892DE65968003E8F50 /* ExceptionCatcher.m in Sources */,
@@ -5309,7 +5306,6 @@
53095306
7BA0C0482805600A003E0326 /* SentryTransportAdapter.m in Sources */,
53105307
63FE712920DA4C1000CDBAE8 /* SentryCrashCPU_arm.c in Sources */,
53115308
03F84D3427DD4191008FE43F /* SentryThreadMetadataCache.cpp in Sources */,
5312-
7B88F30024BC5A7D00ADF90A /* SentrySdkInfo.m in Sources */,
53135309
62862B1E2B1DDC35009B16E3 /* SentryDelayedFrame.m in Sources */,
53145310
84AC61D729F75A98009EEF61 /* SentryDispatchFactory.m in Sources */,
53155311
15360CD62432832400112302 /* SentryAutoSessionTrackingIntegration.m in Sources */,

Sources/Resources/Sentry.modulemap

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

29-
header "SentrySdkInfo.h"
30-
header "SentryExtraPackages.h"
31-
header "SentrySdkPackage.h"
3229
header "SentryInternalSerializable.h"
3330

3431
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 & 132 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)