Skip to content

Commit 8bb3e37

Browse files
authored
ref: Envelope item swift (#6073)
* ref: Convert SentryEnvelopeItem to Swift * Cleanup
1 parent 37238de commit 8bb3e37

25 files changed

+283
-311
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@
400400
7B5AB65D27E48E5200F1D1BA /* TestThreadInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5AB65C27E48E5200F1D1BA /* TestThreadInspector.swift */; };
401401
7B5B94332657A816002E474B /* SentryAppStartTrackingIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5B94322657A816002E474B /* SentryAppStartTrackingIntegrationTests.swift */; };
402402
7B5B94352657AD21002E474B /* SentryFramesTrackingIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5B94342657AD21002E474B /* SentryFramesTrackingIntegrationTests.swift */; };
403-
7B5CAF7127F5953400ED0DB6 /* SentryEnvelope+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5CAF7027F5953400ED0DB6 /* SentryEnvelope+Private.h */; };
404403
7B5CAF7527F5A67C00ED0DB6 /* SentryNSURLRequestBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5CAF7427F5A67C00ED0DB6 /* SentryNSURLRequestBuilder.h */; };
405404
7B5CAF7727F5A68C00ED0DB6 /* SentryNSURLRequestBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B5CAF7627F5A68C00ED0DB6 /* SentryNSURLRequestBuilder.m */; };
406405
7B5CAF7E27F5AD3500ED0DB6 /* TestNSURLRequestBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B5CAF7D27F5AD3500ED0DB6 /* TestNSURLRequestBuilder.m */; };
@@ -1045,6 +1044,7 @@
10451044
FA1841832E4B457F005DEDC7 /* SentryApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA18417D2E4B457B005DEDC7 /* SentryApplication.swift */; };
10461045
FA21A2EF2E60E9CB00E7EADB /* EnvelopeComparison.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA21A2E92E60E9C700E7EADB /* EnvelopeComparison.swift */; };
10471046
FA21F0B42E4A2A80008B4E5A /* SentryAppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4C32972DF7513F001D7B01 /* SentryAppState.swift */; };
1047+
FA34C1A32E692A5000BC52AA /* SentryEnvelopeItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */; };
10481048
FA3734842E0F086C0091EF24 /* SentryDependencyContainerSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */; };
10491049
FA3734862E0F09320091EF24 /* SentryDependencyContainerSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */; };
10501050
FA3854362E267DA60045A563 /* SentryUser+Serialize.h in Headers */ = {isa = PBXBuildFile; fileRef = FA3854352E267DA20045A563 /* SentryUser+Serialize.h */; };
@@ -1660,7 +1660,6 @@
16601660
7B5AB65C27E48E5200F1D1BA /* TestThreadInspector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestThreadInspector.swift; sourceTree = "<group>"; };
16611661
7B5B94322657A816002E474B /* SentryAppStartTrackingIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAppStartTrackingIntegrationTests.swift; sourceTree = "<group>"; };
16621662
7B5B94342657AD21002E474B /* SentryFramesTrackingIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryFramesTrackingIntegrationTests.swift; sourceTree = "<group>"; };
1663-
7B5CAF7027F5953400ED0DB6 /* SentryEnvelope+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryEnvelope+Private.h"; path = "include/SentryEnvelope+Private.h"; sourceTree = "<group>"; };
16641663
7B5CAF7427F5A67C00ED0DB6 /* SentryNSURLRequestBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryNSURLRequestBuilder.h; path = include/SentryNSURLRequestBuilder.h; sourceTree = "<group>"; };
16651664
7B5CAF7627F5A68C00ED0DB6 /* SentryNSURLRequestBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNSURLRequestBuilder.m; sourceTree = "<group>"; };
16661665
7B5CAF7C27F5AD0600ED0DB6 /* TestNSURLRequestBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestNSURLRequestBuilder.h; sourceTree = "<group>"; };
@@ -2391,6 +2390,7 @@
23912390
FA034AC72DD3DB4900FE3107 /* SentryIntegrationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryIntegrationProtocol.h; path = Public/SentryIntegrationProtocol.h; sourceTree = "<group>"; };
23922391
FA18417D2E4B457B005DEDC7 /* SentryApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryApplication.swift; sourceTree = "<group>"; };
23932392
FA21A2E92E60E9C700E7EADB /* EnvelopeComparison.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvelopeComparison.swift; sourceTree = "<group>"; };
2393+
FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeItem.swift; sourceTree = "<group>"; };
23942394
FA3734832E0F07A20091EF24 /* SentryDependencyContainerSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDependencyContainerSwiftHelper.h; path = include/SentryDependencyContainerSwiftHelper.h; sourceTree = "<group>"; };
23952395
FA3734852E0F092F0091EF24 /* SentryDependencyContainerSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDependencyContainerSwiftHelper.m; sourceTree = "<group>"; };
23962396
FA3854352E267DA20045A563 /* SentryUser+Serialize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryUser+Serialize.h"; path = "include/SentryUser+Serialize.h"; sourceTree = "<group>"; };
@@ -2694,7 +2694,6 @@
26942694
isa = PBXGroup;
26952695
children = (
26962696
15E0A8E0240C41CE00F044E3 /* SentryEnvelope.h */,
2697-
7B5CAF7027F5953400ED0DB6 /* SentryEnvelope+Private.h */,
26982697
15E0A8E4240C457D00F044E3 /* SentryEnvelope.m */,
26992698
D8CB74182947285A00A5F964 /* SentryEnvelopeItemHeader.h */,
27002699
D8CB741A2947286500A5F964 /* SentryEnvelopeItemHeader.m */,
@@ -4496,6 +4495,7 @@
44964495
92235CAD2E15549C00865983 /* SentryLogger.swift */,
44974496
92235CAB2E15369900865983 /* SentryLogBatcher.swift */,
44984497
F451FAA52E0B304E0050ACF2 /* LoadValidator.swift */,
4498+
FA34C1A22E692A5000BC52AA /* SentryEnvelopeItem.swift */,
44994499
FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */,
45004500
FA67DCC02DDBD4C800896B02 /* SentrySDKLog+Configure.swift */,
45014501
);
@@ -5129,7 +5129,6 @@
51295129
7B63459D280EBA6300CFA05A /* SentryUIEventTracker.h in Headers */,
51305130
7B7D873424864C6600D2ECFF /* SentryCrashDefaultMachineContextWrapper.h in Headers */,
51315131
7BA61CC8247D125400C130A8 /* SentryThreadInspector.h in Headers */,
5132-
7B5CAF7127F5953400ED0DB6 /* SentryEnvelope+Private.h in Headers */,
51335132
63FE713320DA4C1100CDBAE8 /* SentryCrashCPU.h in Headers */,
51345133
6271ADF32BA06D9B0098D2E9 /* SentryInternalSerializable.h in Headers */,
51355134
D8853C842833EABC00700D64 /* SentryANRTrackerV1.h in Headers */,
@@ -5917,6 +5916,7 @@
59175916
63FE70CB20DA4C1000CDBAE8 /* SentryCrashReportFixer.c in Sources */,
59185917
F4A930232E65FDBF006DA6EF /* SentryMobileProvisionParser.swift in Sources */,
59195918
63FE710F20DA4C1000CDBAE8 /* SentryCrashNSErrorUtil.m in Sources */,
5919+
FA34C1A32E692A5000BC52AA /* SentryEnvelopeItem.swift in Sources */,
59205920
8ECC674925C23A20000E2BF6 /* SentrySpanId.m in Sources */,
59215921
6344DDB51EC309E000D9160D /* SentryCrashReportSink.m in Sources */,
59225922
D43B26D62D70964C007747FD /* SentrySpanOperation.m in Sources */,

SentryTestUtils/TestClient.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import _SentryPrivate
22
import Foundation
3+
@_spi(Private) import Sentry
34

45
public class TestClient: SentryClient {
56
public override init?(options: Options) {
@@ -43,8 +44,8 @@ public class TestClient: SentryClient {
4344
return event.eventId
4445
}
4546

46-
public var captureEventWithScopeInvocations = Invocations<(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem])>()
47-
public override func capture(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem]) -> SentryId {
47+
@_spi(Private) public var captureEventWithScopeInvocations = Invocations<(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem])>()
48+
@_spi(Private) public override func capture(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem]) -> SentryId {
4849
captureEventWithScopeInvocations.record((event, scope, additionalEnvelopeItems))
4950
return event.eventId
5051
}

SentryTestUtils/TestConstants.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@_spi(Private) import Sentry
2+
13
public struct TestConstants {
24

35
/**

SentryTestUtils/TestHub.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public class TestHub: SentryHub {
3636
sentFatalEventsWithScope.record((event, scope))
3737
}
3838

39-
public var capturedEventsWithScopes = Invocations<(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem])>()
40-
public override func capture(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem]) -> SentryId {
39+
@_spi(Private) public var capturedEventsWithScopes = Invocations<(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem])>()
40+
@_spi(Private) public override func capture(event: Event, scope: Scope, additionalEnvelopeItems: [SentryEnvelopeItem]) -> SentryId {
4141

4242
self.capturedEventsWithScopes.record((event, scope, additionalEnvelopeItems))
4343

SentryTestUtils/TestTransportAdapter.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import _SentryPrivate
22
import Foundation
3+
@_spi(Private) import Sentry
34

45
public class TestTransportAdapter: SentryTransportAdapter {
56
@_spi(Private)
@@ -9,12 +10,12 @@ public class TestTransportAdapter: SentryTransportAdapter {
910
sentEventsWithSessionTraceState.record((event, session, traceContext, attachments))
1011
}
1112

12-
public var sendEventWithTraceStateInvocations = Invocations<(event: Event, traceContext: TraceContext?, attachments: [Attachment], additionalEnvelopeItems: [SentryEnvelopeItem])>()
13+
@_spi(Private) public var sendEventWithTraceStateInvocations = Invocations<(event: Event, traceContext: TraceContext?, attachments: [Attachment], additionalEnvelopeItems: [SentryEnvelopeItem])>()
1314
public override func send(event: Event, traceContext: TraceContext?, attachments: [Attachment]) {
1415
sendEventWithTraceStateInvocations.record((event, traceContext, attachments, []))
1516
}
1617

17-
public override func send(event: Event, traceContext: TraceContext?, attachments: [Attachment], additionalEnvelopeItems: [SentryEnvelopeItem]) {
18+
@_spi(Private) public override func send(event: Event, traceContext: TraceContext?, attachments: [Attachment], additionalEnvelopeItems: [SentryEnvelopeItem]) {
1819
sendEventWithTraceStateInvocations.record((event, traceContext, attachments, additionalEnvelopeItems))
1920
}
2021

Sources/Sentry/SentryClient.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#import "SentryDebugImageProvider+HybridSDKs.h"
99
#import "SentryDependencyContainer.h"
1010
#import "SentryDsn.h"
11-
#import "SentryEnvelope+Private.h"
11+
#import "SentryEnvelope.h"
1212
#import "SentryEvent+Private.h"
1313
#import "SentryException.h"
1414
#import "SentryExtraContextProvider.h"

0 commit comments

Comments
 (0)