Skip to content

Commit 496f9a5

Browse files
authored
Merge 9ef599d into 3b059e5
2 parents 3b059e5 + 9ef599d commit 496f9a5

File tree

21 files changed

+640
-193
lines changed

21 files changed

+640
-193
lines changed

.github/workflows/test-cross-platform.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
with:
5656
repository: getsentry/sentry-react-native
5757
path: sentry-react-native
58+
ref: itay/fix_sentreyscreenframes
5859

5960
- name: Enable Corepack
6061
working-directory: sentry-react-native

Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import AuthenticationServices
33
import Foundation
44
import SafariServices
5-
import Sentry
5+
@_spi(Private) import Sentry
66
import SentrySampleShared
77
import UIKit
88

Sentry.xcodeproj/project.pbxproj

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,6 @@
427427
7B72D23A28D074BC0014798A /* TestExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B72D23928D074BC0014798A /* TestExtensions.swift */; };
428428
7B77BE3527EC8445003C9020 /* SentryDiscardReasonMapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B77BE3427EC8445003C9020 /* SentryDiscardReasonMapper.h */; };
429429
7B77BE3727EC8460003C9020 /* SentryDiscardReasonMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B77BE3627EC8460003C9020 /* SentryDiscardReasonMapper.m */; };
430-
7B7A599526B692540060A676 /* SentryScreenFrames.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B7A599426B692540060A676 /* SentryScreenFrames.h */; settings = {ATTRIBUTES = (Private, ); }; };
431-
7B7A599726B692F00060A676 /* SentryScreenFrames.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B7A599626B692F00060A676 /* SentryScreenFrames.m */; };
432430
7B7D872C2486480B00D2ECFF /* SentryStacktraceBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B7D872B2486480B00D2ECFF /* SentryStacktraceBuilder.h */; };
433431
7B7D872E2486482600D2ECFF /* SentryStacktraceBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B7D872D2486482600D2ECFF /* SentryStacktraceBuilder.m */; };
434432
7B7D8730248648AD00D2ECFF /* SentryStacktraceBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B7D872F248648AD00D2ECFF /* SentryStacktraceBuilderTests.swift */; };
@@ -995,6 +993,10 @@
995993
F41362152E1C568400B84443 /* SentryScopePersistentStore+Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41362142E1C568400B84443 /* SentryScopePersistentStore+Context.swift */; };
996994
F443DB272E09BE8C009A9045 /* LoadValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F443DB262E09BE8C009A9045 /* LoadValidatorTests.swift */; };
997995
F44858132E03579D0013E63B /* SentryCrashDynamicLinker+Test.h in Headers */ = {isa = PBXBuildFile; fileRef = F44858122E0357940013E63B /* SentryCrashDynamicLinker+Test.h */; };
996+
F44D2B592E6B779E00FF31FA /* SentryScreenFrames.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44D2B582E6B779E00FF31FA /* SentryScreenFrames.swift */; };
997+
F44D2B5C2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = F44D2B5A2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.h */; };
998+
F44D2B5D2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = F44D2B5B2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.m */; };
999+
F44D2B602E6B829F00FF31FA /* SentryScreenFramesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44D2B5F2E6B829F00FF31FA /* SentryScreenFramesTests.swift */; };
9981000
F451FAA62E0B304E0050ACF2 /* LoadValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F451FAA52E0B304E0050ACF2 /* LoadValidator.swift */; };
9991001
F452437E2DE60B71003E8F50 /* SentryUseNSExceptionCallstackWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = F452437D2DE60B71003E8F50 /* SentryUseNSExceptionCallstackWrapper.m */; };
10001002
F45243882DE65968003E8F50 /* ExceptionCatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = F45243872DE65968003E8F50 /* ExceptionCatcher.m */; };
@@ -1689,8 +1691,6 @@
16891691
7B77BE3427EC8445003C9020 /* SentryDiscardReasonMapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDiscardReasonMapper.h; path = include/SentryDiscardReasonMapper.h; sourceTree = "<group>"; };
16901692
7B77BE3627EC8460003C9020 /* SentryDiscardReasonMapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDiscardReasonMapper.m; sourceTree = "<group>"; };
16911693
7B7A30C924B48523005A4C6E /* SentryHub+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryHub+Test.h"; sourceTree = "<group>"; };
1692-
7B7A599426B692540060A676 /* SentryScreenFrames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryScreenFrames.h; path = include/HybridPublic/SentryScreenFrames.h; sourceTree = "<group>"; };
1693-
7B7A599626B692F00060A676 /* SentryScreenFrames.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryScreenFrames.m; sourceTree = "<group>"; };
16941694
7B7D872B2486480B00D2ECFF /* SentryStacktraceBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryStacktraceBuilder.h; path = include/SentryStacktraceBuilder.h; sourceTree = "<group>"; };
16951695
7B7D872D2486482600D2ECFF /* SentryStacktraceBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryStacktraceBuilder.m; sourceTree = "<group>"; };
16961696
7B7D872F248648AD00D2ECFF /* SentryStacktraceBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryStacktraceBuilderTests.swift; sourceTree = "<group>"; };
@@ -2338,6 +2338,10 @@
23382338
F41362142E1C568400B84443 /* SentryScopePersistentStore+Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryScopePersistentStore+Context.swift"; sourceTree = "<group>"; };
23392339
F443DB262E09BE8C009A9045 /* LoadValidatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadValidatorTests.swift; sourceTree = "<group>"; };
23402340
F44858122E0357940013E63B /* SentryCrashDynamicLinker+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryCrashDynamicLinker+Test.h"; sourceTree = "<group>"; };
2341+
F44D2B582E6B779E00FF31FA /* SentryScreenFrames.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenFrames.swift; sourceTree = "<group>"; };
2342+
F44D2B5A2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProfilingScreenFramesHelper.h; sourceTree = "<group>"; };
2343+
F44D2B5B2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProfilingScreenFramesHelper.m; sourceTree = "<group>"; };
2344+
F44D2B5F2E6B829F00FF31FA /* SentryScreenFramesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryScreenFramesTests.swift; sourceTree = "<group>"; };
23412345
F451FAA52E0B304E0050ACF2 /* LoadValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadValidator.swift; sourceTree = "<group>"; };
23422346
F452437D2DE60B71003E8F50 /* SentryUseNSExceptionCallstackWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryUseNSExceptionCallstackWrapper.m; sourceTree = "<group>"; };
23432347
F45243862DE65968003E8F50 /* ExceptionCatcher.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExceptionCatcher.h; sourceTree = "<group>"; };
@@ -2629,6 +2633,7 @@
26292633
62872B602BA1B84400A4FA7D /* Swift */ = {
26302634
isa = PBXGroup;
26312635
children = (
2636+
F44D2B612E6B82A800FF31FA /* Profiling */,
26322637
F443DB242E09BE61009A9045 /* Core */,
26332638
62872B612BA1B84C00A4FA7D /* Extensions */,
26342639
);
@@ -3687,8 +3692,6 @@
36873692
7B30B67D26527894006B2752 /* SentryDisplayLinkWrapper.m */,
36883693
7B6C5EDF264E8E050010D138 /* SentryFramesTracker.h */,
36893694
7B6C5EDD264E8DF00010D138 /* SentryFramesTracker.m */,
3690-
7B7A599426B692540060A676 /* SentryScreenFrames.h */,
3691-
7B7A599626B692F00060A676 /* SentryScreenFrames.m */,
36923695
62862B1B2B1DDBC8009B16E3 /* SentryDelayedFrame.h */,
36933696
62862B1D2B1DDC35009B16E3 /* SentryDelayedFrame.m */,
36943697
62C316802B1F2E93000D7031 /* SentryDelayedFramesTracker.h */,
@@ -3924,6 +3927,8 @@
39243927
8459FCC12BD73EEF0038E9C9 /* SentryProfilerSerialization+Test.h */,
39253928
84AF45A429A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h */,
39263929
84AF45A529A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm */,
3930+
F44D2B5A2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.h */,
3931+
F44D2B5B2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.m */,
39273932
840B7EF22BBF83DF008B8120 /* SentryProfiler+Private.h */,
39283933
84A898522E163072009A551E /* SentryProfileConfiguration.h */,
39293934
84A898532E163072009A551E /* SentryProfileConfiguration.m */,
@@ -4733,6 +4738,14 @@
47334738
path = Tools;
47344739
sourceTree = "<group>";
47354740
};
4741+
F44D2B612E6B82A800FF31FA /* Profiling */ = {
4742+
isa = PBXGroup;
4743+
children = (
4744+
F44D2B5F2E6B829F00FF31FA /* SentryScreenFramesTests.swift */,
4745+
);
4746+
path = Profiling;
4747+
sourceTree = "<group>";
4748+
};
47364749
F474CB872E2EC5040001DF41 /* Recovered References */ = {
47374750
isa = PBXGroup;
47384751
children = (
@@ -4796,6 +4809,7 @@
47964809
FA67DCD22DDBD4EA00896B02 /* FramesTracking */ = {
47974810
isa = PBXGroup;
47984811
children = (
4812+
F44D2B582E6B779E00FF31FA /* SentryScreenFrames.swift */,
47994813
FA67DCD12DDBD4EA00896B02 /* SentryFramesDelayResult.swift */,
48004814
);
48014815
path = FramesTracking;
@@ -5054,6 +5068,7 @@
50545068
6383953623ABA42C000C1594 /* SentryHttpTransport.h in Headers */,
50555069
84A8891C28DBD28900C51DFD /* SentryDevice.h in Headers */,
50565070
8E564AEF267AF24400FE117D /* SentryNetworkTracker.h in Headers */,
5071+
F44D2B5C2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.h in Headers */,
50575072
63FE715120DA4C1100CDBAE8 /* SentryCrashDebug.h in Headers */,
50585073
63FE70F520DA4C1000CDBAE8 /* SentryCrashMonitor_System.h in Headers */,
50595074
FAB359982E05D7E90083D5E3 /* SentryEventSwiftHelper.h in Headers */,
@@ -5156,7 +5171,6 @@
51565171
7BA61CAB247BA98100C130A8 /* SentryDebugImageProvider.h in Headers */,
51575172
7BC63F0828081242009D9E37 /* SentrySwizzleWrapper.h in Headers */,
51585173
638DC9A01EBC6B6400A66E41 /* SentryRequestOperation.h in Headers */,
5159-
7B7A599526B692540060A676 /* SentryScreenFrames.h in Headers */,
51605174
6344DDB01EC308E400D9160D /* SentryCrashInstallationReporter.h in Headers */,
51615175
7B5CAF7527F5A67C00ED0DB6 /* SentryNSURLRequestBuilder.h in Headers */,
51625176
63FE70ED20DA4C1000CDBAE8 /* SentryCrashMonitor_NSException.h in Headers */,
@@ -5574,7 +5588,6 @@
55745588
D84D2CDF2C2BF9370011AF8A /* SentryReplayType.swift in Sources */,
55755589
63FE717B20DA4C1100CDBAE8 /* SentryCrashReport.c in Sources */,
55765590
D8F67B222BEAB6CC00C9197B /* SentryRRWebEvent.swift in Sources */,
5577-
7B7A599726B692F00060A676 /* SentryScreenFrames.m in Sources */,
55785591
84A903712D39F66F00690CE4 /* SentryUserFeedbackFormViewModel.swift in Sources */,
55795592
7B3398652459C15200BD9C96 /* SentryEnvelopeRateLimit.m in Sources */,
55805593
D81988C92BEC19200020E36C /* SentryRRWebBreadcrumbEvent.swift in Sources */,
@@ -5717,6 +5730,7 @@
57175730
627C77892D50B6840055E966 /* SentryBreadcrumbCodable.swift in Sources */,
57185731
63FE70D720DA4C1000CDBAE8 /* SentryCrashMonitor_MachException.c in Sources */,
57195732
7B96572226830D2400C66E25 /* SentryScopeSyncC.c in Sources */,
5733+
F44D2B5D2E6B7E8700FF31FA /* SentryProfilingScreenFramesHelper.m in Sources */,
57205734
0A9BF4E228A114940068D266 /* SentryViewHierarchyIntegration.m in Sources */,
57215735
7BBD188B244841FB00427C76 /* SentryHttpDateParser.m in Sources */,
57225736
D8AFC03D2BDA79BF00118BE1 /* SentryReplayVideoMaker.swift in Sources */,
@@ -5809,6 +5823,7 @@
58095823
A8F17B2E2901765900990B25 /* SentryRequest.m in Sources */,
58105824
FABE8E172E307A7F0040809A /* Dependencies.swift in Sources */,
58115825
D4ECA4012E3CBEDE00C757EA /* SentryDummyPublicEmptyClass.m in Sources */,
5826+
F44D2B592E6B779E00FF31FA /* SentryScreenFrames.swift in Sources */,
58125827
D4ECA4022E3CBEDE00C757EA /* SentryDummyPrivateEmptyClass.m in Sources */,
58135828
D80299502BA83A88000F0081 /* SentryPixelBuffer.swift in Sources */,
58145829
15E0A8F22411A45A00F044E3 /* SentrySessionInternal.m in Sources */,
@@ -6241,6 +6256,7 @@
62416256
D884A20527C80F6300074664 /* SentryCoreDataTrackerTest.swift in Sources */,
62426257
8E70B10125CB8695002B3155 /* SentrySpanIdTests.swift in Sources */,
62436258
62E2119A2DAE99FC007D7262 /* SentryAsyncSafeLog.m in Sources */,
6259+
F44D2B602E6B829F00FF31FA /* SentryScreenFramesTests.swift in Sources */,
62446260
84EB21962BF01CEA00EDDA28 /* SentryCrashInstallationTests.swift in Sources */,
62456261
7BFE7A0A27A1B6B000D2B66E /* SentryWatchdogTerminationTrackingIntegrationTests.swift in Sources */,
62466262
FA6614FC2E4B8E1A00657755 /* TestSentryUIApplication.swift in Sources */,

SentryTestUtils/TestFramesTracker.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import Sentry
1+
@_spi(Private) @testable import Sentry
22

33
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
44
public class TestFramesTracker: SentryFramesTracker {
5-
public var expectedFrames: SentryScreenFrames?
5+
@_spi(Private) public var expectedFrames: SentryScreenFrames?
66

7-
public override func currentFrames() -> SentryScreenFrames {
7+
@_spi(Private) public override func currentFrames() -> SentryScreenFrames {
88
expectedFrames ?? super.currentFrames()
99
}
1010
}

Sources/Resources/Sentry.modulemap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ framework module Sentry {
1515
header "SentryFormatter.h"
1616
header "SentryFramesTracker.h"
1717
header "SentryOptionsInternal.h"
18-
header "SentryScreenFrames.h"
1918
header "SentrySwizzle.h"
2019
header "SentryUser+Private.h"
2120

Sources/Sentry/Profiling/SentryContinuousProfiler.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# import "SentryProfiler+Private.h"
1010
# import "SentryProfilerSerialization.h"
1111
# import "SentryProfilerState.h"
12+
# import "SentryProfilingScreenFramesHelper.h"
1213
# import "SentryProfilingSwiftHelpers.h"
1314
# import "SentrySDK+Private.h"
1415
# import "SentrySample.h"
1516
# include <mutex>
1617

1718
# if SENTRY_HAS_UIKIT
1819
# import "SentryFramesTracker.h"
19-
# import "SentryScreenFrames.h"
2020
# import <UIKit/UIKit.h>
2121
# endif // SENTRY_HAS_UIKIT
2222

@@ -72,7 +72,8 @@
7272

7373
# if SENTRY_HAS_UIKIT
7474
const auto framesTracker = SentryDependencyContainer.sharedInstance.framesTracker;
75-
SentryScreenFrames *screenFrameData = [framesTracker.currentFrames copy];
75+
SentryScreenFrames *screenFrameData =
76+
[SentryProfilingScreenFramesHelper copyScreenFrames:framesTracker.currentFrames];
7677
[framesTracker resetProfilingTimestamps];
7778
# endif // SENTRY_HAS_UIKIT
7879

Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# if SENTRY_HAS_UIKIT
3030
# import "SentryAppStartMeasurement.h"
3131
# import "SentryFramesTracker.h"
32-
# import "SentryScreenFrames.h"
32+
# import "SentryProfilingScreenFramesHelper.h"
3333
# endif // SENTRY_HAS_UIKIT
3434

3535
/**
@@ -236,8 +236,8 @@
236236
_unsafe_cleanUpTraceProfiler(profiler, tracerKey);
237237

238238
# if SENTRY_HAS_UIKIT
239-
profiler.screenFrameData =
240-
[SentryDependencyContainer.sharedInstance.framesTracker.currentFrames copy];
239+
profiler.screenFrameData = [SentryProfilingScreenFramesHelper
240+
copyScreenFrames:SentryDependencyContainer.sharedInstance.framesTracker.currentFrames];
241241
SENTRY_LOG_DEBUG(
242242
@"Grabbing copy of frames tracker screen frames data to attach to profiler: %@.",
243243
profiler.screenFrameData);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#import "SentryDefines.h"
2+
#import <Foundation/Foundation.h>
3+
4+
#if SENTRY_HAS_UIKIT
5+
6+
NS_ASSUME_NONNULL_BEGIN
7+
8+
@class SentryScreenFrames;
9+
10+
// Helper to use SentryScreenFrames without importing Swift on ObjC++ files.
11+
// Right now we don't have Clang modules enabled, so we cannot use `@import Sentry;`
12+
// and then no Swift class is visible to Objective C++.
13+
@interface SentryProfilingScreenFramesHelper : NSObject
14+
+ (SentryScreenFrames *)copyScreenFrames:(SentryScreenFrames *)screenFrames;
15+
@end
16+
17+
NS_ASSUME_NONNULL_END
18+
19+
#endif // SENTRY_HAS_UIKIT
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#import "SentryProfilingScreenFramesHelper.h"
2+
#import "SentrySwift.h"
3+
4+
#if SENTRY_HAS_UIKIT
5+
6+
@implementation SentryProfilingScreenFramesHelper
7+
8+
+ (SentryScreenFrames *)copyScreenFrames:(SentryScreenFrames *)screenFrames
9+
{
10+
return [screenFrames copy];
11+
}
12+
13+
@end
14+
15+
#endif // SENTRY_HAS_UIKIT

Sources/Sentry/SentryFramesTracker.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# import "SentrySwift.h"
1414
# import "SentryTime.h"
1515
# import "SentryTracer.h"
16-
# import <SentryScreenFrames.h>
1716
# include <stdatomic.h>
1817

1918
# if SENTRY_TARGET_PROFILING_SUPPORTED

0 commit comments

Comments
 (0)