Skip to content

Commit ed94dd2

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/setup-java-5.5.0
2 parents baf6b50 + f097596 commit ed94dd2

38 files changed

Lines changed: 717 additions & 265 deletions

.github/pull_request_template.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
## :scroll: Description
10-
<!--- Describe your changes in detail -->
10+
<!--- Describe your changes in detail and optionally add screenshots -->
1111

1212

1313
## :bulb: Motivation and Context
@@ -16,6 +16,10 @@
1616

1717

1818
## :green_heart: How did you test it?
19+
<!---
20+
Include a link to Sentry when applicable:
21+
* Link to Sentry: <LINK>
22+
-->
1923

2024

2125
## :pencil: Checklist

.github/workflows/changes-in-high-risk-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2020
- name: Get changed files
2121
id: changes
22-
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
22+
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
2323
with:
2424
token: ${{ github.token }}
2525
filters: .github/file-filters.yml

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ jobs:
6666
# make bootstrap
6767
# make release
6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # pin@v4.36.3
69+
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # pin@v4.37.0

.github/workflows/detect-changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8383

8484
- name: Detect changed paths
85-
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
85+
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
8686
id: filter
8787
with:
8888
filters: .github/file-filters.yml

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212

1313
- Add `Sentry.reportFullyDisplayed()` imperative API for signaling Time to Full Display ([#6419](https://github.com/getsentry/sentry-react-native/pull/6419))
1414

15+
### Fixes
16+
17+
- Fix iOS time-to-initial-display fallback spans reporting a spurious `deadline_exceeded` status and inflated duration ([#6438](https://github.com/getsentry/sentry-react-native/pull/6438))
18+
- Fix `TypeError` when `showFeedbackForm`/`showFeedbackButton`/`showScreenshotButton` is called before `FeedbackFormProvider` mounts ([#6435](https://github.com/getsentry/sentry-react-native/pull/6435))
19+
- Fix orphaned TTID/TTFD spans in the trace view ([#6437](https://github.com/getsentry/sentry-react-native/pull/6437))
20+
- Fix iOS retain cycle in `RNSentryOnDrawReporterView` leaking TTID/TTFD reporter views and their frame-tracker listeners ([#6449](https://github.com/getsentry/sentry-react-native/pull/6449))
21+
22+
### Internal
23+
24+
- Migrate iOS code from the deprecated `PrivateSentrySDKOnly` SPI (and `SentrySwizzle.h` macro) to the new `SentrySDK.internal` Swift API exposed by sentry-cocoa 9.19.0, via a thin in-pod ObjC↔Swift bridge ([#6380](https://github.com/getsentry/sentry-react-native/pull/6380))
25+
26+
### Dependencies
27+
28+
- Bump JavaScript SDK from v10.64.0 to v10.65.0 ([#6441](https://github.com/getsentry/sentry-react-native/pull/6441))
29+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10650)
30+
- [diff](https://github.com/getsentry/sentry-javascript/compare/10.64.0...10.65.0)
31+
1532
## 8.18.0
1633

1734
### Features
@@ -25,6 +42,7 @@
2542
**Warning**
2643

2744
**This may be a breaking change for some setups.** `pod install` now downloads `Sentry.xcframework` from sentry-cocoa's GitHub release (SHA256-verified) and vendors it, instead of building Sentry from source as a CocoaPod. If your iOS build breaks after upgrading (e.g. when another pod also depends on the `Sentry` CocoaPod), or if your `pod install` environment cannot reach `github.com`, set `SENTRY_USE_XCFRAMEWORK=0` before `pod install` to restore the previous source-build behavior.
45+
- **iOS:** On React Native versions where `React-hermes` (or another RN pod) is not modularized by default (e.g. RN 0.71), add `use_modular_headers!` to your `ios/Podfile` above the `target` block. This is required because the `RNSentry` pod now contains Swift code (the new `RNSentryInternal` bridge over `SentrySDK.internal`) and CocoaPods refuses to integrate a Swift pod against non-modular ObjC dependencies. Newer React Native versions require no change ([#6380](https://github.com/getsentry/sentry-react-native/pull/6380)).
2846

2947
### Fixes
3048

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"devDependencies": {
1414
"@babel/preset-env": "^7.25.3",
1515
"@babel/preset-typescript": "^7.18.6",
16-
"@sentry/core": "10.64.0",
16+
"@sentry/core": "10.65.0",
1717
"@sentry/react-native": "8.18.0",
1818
"@types/node": "^20.9.3",
1919
"@types/react": "^19.1.4",

dev-packages/e2e-tests/patch-scripts/rn.patch.podfile.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,27 @@ if (currentMatch) {
6363
debug.log('Warning: Could not find platform :ios line to patch');
6464
}
6565

66+
// RNSentry now contains Swift code (via the RNSentryInternal bridge over
67+
// SentrySDK.internal). CocoaPods refuses to integrate a Swift pod against
68+
// non-modular ObjC dependencies (e.g. React-hermes on older RN versions),
69+
// so ensure the Podfile requests modular headers globally.
70+
let modularPatched = false;
71+
if (!content.includes('use_modular_headers!')) {
72+
const patched = content.replace(
73+
/prepare_react_native_project!\s*\n/,
74+
"prepare_react_native_project!\nuse_modular_headers!\n",
75+
);
76+
if (patched !== content) {
77+
content = patched;
78+
modularPatched = true;
79+
debug.log('Patching Podfile with use_modular_headers!');
80+
} else {
81+
debug.log('Warning: Could not find prepare_react_native_project! anchor to inject use_modular_headers!');
82+
}
83+
}
84+
6685
// Write the file if any changes were made
67-
if (shouldPatch || currentMatch) {
86+
if (shouldPatch || currentMatch || modularPatched) {
6887
fs.writeFileSync(args['pod-file'], content);
6988
debug.log('Podfile patched successfully!');
7089
} else {

packages/core/RNSentry.podspec

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,15 @@ Pod::Spec.new do |s|
4646
# in `android/CMakeLists.txt`. The files are guarded with
4747
# `RCT_NEW_ARCH_ENABLED` so they compile to empty TUs on Old Arch.
4848
#
49-
# We include `.swift` (for `RNSentrySwiftLinkStub.swift`) only on RN >=
50-
# 0.75. Adding a Swift file makes CocoaPods treat RNSentry as a Swift
51-
# pod, which then requires modular headers from its ObjC dependencies
52-
# (React-Core, React-hermes) — RN < 0.75 doesn't emit those, so
53-
# `pod install` fails with:
54-
# "The Swift pod `RNSentry` depends upon `React-hermes`, which does
55-
# not define modules."
56-
# The stub is only needed when linking Sentry.xcframework's Swift
57-
# symbols into a dynamic framework anyway (RN 0.86+ `use_frameworks!
58-
# :dynamic`), so gating on RN 0.75 is safe.
59-
supports_swift_stub = rn_version[:major] >= 1 || (rn_version[:major] == 0 && rn_version[:minor] >= 75)
60-
if supports_swift_stub
61-
s.source_files = 'ios/**/*.{h,m,mm,swift}', 'cpp/**/*.{h,cpp}'
62-
s.swift_versions = ['5.5']
63-
else
64-
s.source_files = 'ios/**/*.{h,m,mm}', 'cpp/**/*.{h,cpp}'
65-
end
49+
# Swift is compiled unconditionally because `RNSentryInternal.swift` is
50+
# the sole ObjC↔Swift bridge over `SentrySDK.internal.*` — every `.m`/
51+
# `.mm` file in this pod calls into it. That makes RNSentry a Swift pod
52+
# in CocoaPods' eyes, which in turn requires modular headers from its
53+
# ObjC dependencies. Users on React Native < 0.75 (where `React-hermes`
54+
# and friends aren't modularized by default) must add
55+
# `use_modular_headers!` to their Podfile — see CHANGELOG.
56+
s.source_files = 'ios/**/*.{h,m,mm,swift}', 'cpp/**/*.{h,cpp}'
57+
s.swift_versions = ['5.5']
6658
s.public_header_files = 'ios/RNSentry.h', 'ios/RNSentrySDK.h', 'ios/RNSentryStart.h', 'ios/RNSentryVersion.h', 'ios/RNSentryBreadcrumb.h', 'ios/RNSentryReplay.h', 'ios/RNSentryReplayBreadcrumbConverter.h', 'ios/Replay/RNSentryReplayMask.h', 'ios/Replay/RNSentryReplayUnmask.h', 'ios/RNSentryTimeToDisplay.h'
6759

6860
s.compiler_flags = other_cflags

packages/core/RNSentryCocoaTester/RNSentryCocoaTester.xcodeproj/project.pbxproj

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
2639D71D3BD04F17B0BAC987 /* RNSentryTurboModulePerfControllerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = E795057A6D534A80A9D06356 /* RNSentryTurboModulePerfControllerTests.mm */; };
1011
332D33472CDBDBB600547D76 /* RNSentryReplayOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 332D33462CDBDBB600547D76 /* RNSentryReplayOptionsTests.swift */; };
1112
3339C4812D6625570088EB3A /* RNSentryUserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3339C4802D6625570088EB3A /* RNSentryUserTests.m */; };
1213
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */; };
@@ -17,7 +18,6 @@
1718
33DEDFED2D8DC825006066E4 /* RNSentryOnDrawReporter+Test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33DEDFEC2D8DC820006066E4 /* RNSentryOnDrawReporter+Test.mm */; };
1819
33DEDFF02D9185EB006066E4 /* RNSentryTimeToDisplayTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33DEDFEF2D9185E3006066E4 /* RNSentryTimeToDisplayTests.swift */; };
1920
33F58AD02977037D008F60EA /* RNSentryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F58ACF2977037D008F60EA /* RNSentryTests.m */; };
20-
2639D71D3BD04F17B0BAC987 /* RNSentryTurboModulePerfControllerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = E795057A6D534A80A9D06356 /* RNSentryTurboModulePerfControllerTests.mm */; };
2121
AEFB00422CC90C4B00EC8A9A /* RNSentryBreadcrumbTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3360843C2C340C76008CC412 /* RNSentryBreadcrumbTests.swift */; };
2222
B4DEB41739F14AA38202D4D4 /* RNSentryUriValidationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E3742693F7643C2ADE1BDF2 /* RNSentryUriValidationTests.m */; };
2323
B5859A50A3E865EF5E61465A /* libPods-RNSentryCocoaTesterTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 650CB718ACFBD05609BF2126 /* libPods-RNSentryCocoaTesterTests.a */; };
@@ -52,8 +52,8 @@
5252
33F58ACF2977037D008F60EA /* RNSentryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSentryTests.m; sourceTree = "<group>"; };
5353
3E3742693F7643C2ADE1BDF2 /* RNSentryUriValidationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNSentryUriValidationTests.m; sourceTree = "<group>"; };
5454
650CB718ACFBD05609BF2126 /* libPods-RNSentryCocoaTesterTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNSentryCocoaTesterTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
55-
E795057A6D534A80A9D06356 /* RNSentryTurboModulePerfControllerTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNSentryTurboModulePerfControllerTests.mm; sourceTree = "<group>"; };
5655
E2321E7CFA55AB617247098E /* Pods-RNSentryCocoaTesterTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNSentryCocoaTesterTests.debug.xcconfig"; path = "Target Support Files/Pods-RNSentryCocoaTesterTests/Pods-RNSentryCocoaTesterTests.debug.xcconfig"; sourceTree = "<group>"; };
56+
E795057A6D534A80A9D06356 /* RNSentryTurboModulePerfControllerTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNSentryTurboModulePerfControllerTests.mm; sourceTree = "<group>"; };
5757
F48F26542EA2A481008A185E /* RNSentryEmitNewFrameEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNSentryEmitNewFrameEvent.h; path = ../ios/RNSentryEmitNewFrameEvent.h; sourceTree = SOURCE_ROOT; };
5858
F48F26552EA2A4D4008A185E /* RNSentryFramesTrackerListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNSentryFramesTrackerListener.h; path = ../ios/RNSentryFramesTrackerListener.h; sourceTree = SOURCE_ROOT; };
5959
FADF868E2EBD053E00D6652D /* SentrySDKWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentrySDKWrapper.h; path = ../ios/SentrySDKWrapper.h; sourceTree = SOURCE_ROOT; };
@@ -169,6 +169,7 @@
169169
3360898929524164007C7730 /* Sources */,
170170
BB7D14838753E6599863899B /* Frameworks */,
171171
CC7959F3721CB3AD7CB6A047 /* [CP] Copy Pods Resources */,
172+
2AA6DCCDB9B6D20211E939EC /* [CP] Embed Pods Frameworks */,
172173
);
173174
buildRules = (
174175
);
@@ -214,6 +215,23 @@
214215
/* End PBXProject section */
215216

216217
/* Begin PBXShellScriptBuildPhase section */
218+
2AA6DCCDB9B6D20211E939EC /* [CP] Embed Pods Frameworks */ = {
219+
isa = PBXShellScriptBuildPhase;
220+
buildActionMask = 2147483647;
221+
files = (
222+
);
223+
inputFileListPaths = (
224+
"${PODS_ROOT}/Target Support Files/Pods-RNSentryCocoaTesterTests/Pods-RNSentryCocoaTesterTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
225+
);
226+
name = "[CP] Embed Pods Frameworks";
227+
outputFileListPaths = (
228+
"${PODS_ROOT}/Target Support Files/Pods-RNSentryCocoaTesterTests/Pods-RNSentryCocoaTesterTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
229+
);
230+
runOnlyForDeploymentPostprocessing = 0;
231+
shellPath = /bin/sh;
232+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNSentryCocoaTesterTests/Pods-RNSentryCocoaTesterTests-frameworks.sh\"\n";
233+
showEnvVarsInLog = 0;
234+
};
217235
30F19D4E16BEEFEC68733838 /* [CP] Check Pods Manifest.lock */ = {
218236
isa = PBXShellScriptBuildPhase;
219237
buildActionMask = 2147483647;
@@ -334,14 +352,23 @@
334352
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
335353
MTL_FAST_MATH = YES;
336354
ONLY_ACTIVE_ARCH = YES;
355+
OTHER_CFLAGS = (
356+
"$(inherited)",
357+
"-DRCT_REMOVE_LEGACY_ARCH=1",
358+
);
359+
OTHER_CPLUSPLUSFLAGS = (
360+
"$(inherited)",
361+
"-DRCT_REMOVE_LEGACY_ARCH=1",
362+
);
337363
OTHER_LDFLAGS = (
338364
"$(inherited)",
339365
" ",
340366
);
367+
PODFILE_DIR = "$(SRCROOT)";
341368
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
342369
SDKROOT = iphoneos;
343370
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
344-
USE_HERMES = false;
371+
USE_HERMES = true;
345372
};
346373
name = Debug;
347374
};
@@ -393,13 +420,22 @@
393420
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
394421
MTL_ENABLE_DEBUG_INFO = NO;
395422
MTL_FAST_MATH = YES;
423+
OTHER_CFLAGS = (
424+
"$(inherited)",
425+
"-DRCT_REMOVE_LEGACY_ARCH=1",
426+
);
427+
OTHER_CPLUSPLUSFLAGS = (
428+
"$(inherited)",
429+
"-DRCT_REMOVE_LEGACY_ARCH=1",
430+
);
396431
OTHER_LDFLAGS = (
397432
"$(inherited)",
398433
" ",
399434
);
435+
PODFILE_DIR = "$(SRCROOT)";
400436
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
401437
SDKROOT = iphoneos;
402-
USE_HERMES = false;
438+
USE_HERMES = true;
403439
VALIDATE_PRODUCT = YES;
404440
};
405441
name = Release;

packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryOnDrawReporterTests.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,22 @@ final class RNSentryOnDrawReporterTests: XCTestCase {
145145

146146
emitNewFrameCallback!(1)
147147
}
148+
149+
func testReporterViewIsDeallocatedAfterRelease() {
150+
// Guards against the retain cycle described in
151+
// https://github.com/getsentry/sentry-react-native/issues/6440 where the
152+
// emit-new-frame block captured `self` strongly, keeping the view (and
153+
// its frames-tracker listener) alive forever.
154+
weak var weakReporter: RNSentryOnDrawReporterView?
155+
156+
autoreleasepool {
157+
let reporter = RNSentryOnDrawReporterView.createWithMockedListener()
158+
reporter!.initialDisplay = true
159+
reporter!.parentSpanId = spanId
160+
reporter!.didSetProps(["initialDisplay", "parentSpanId"])
161+
weakReporter = reporter
162+
}
163+
164+
XCTAssertNil(weakReporter, "RNSentryOnDrawReporterView leaked due to a retain cycle")
165+
}
148166
}

0 commit comments

Comments
 (0)