Skip to content

Commit 063bfce

Browse files
Merge cfd5aee into 30e2d76
2 parents 30e2d76 + cfd5aee commit 063bfce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1870
-64
lines changed

CHANGELOG.md

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@
55
### Features
66

77
- Improve touch event component info if annotated with [`@sentry/babel-plugin-component-annotate`](https://www.npmjs.com/package/@sentry/babel-plugin-component-annotate) ([#3899](https://github.com/getsentry/sentry-react-native/pull/3899))
8+
- Add replay breadcrumbs for touch & navigation events ([#3846](https://github.com/getsentry/sentry-react-native/pull/3846))
9+
- Add network data to Session Replays ([#3912](https://github.com/getsentry/sentry-react-native/pull/3912))
10+
- Filter Sentry Event Breadcrumbs from Mobile Replays ([#3925](https://github.com/getsentry/sentry-react-native/pull/3925))
811

912
### Fixes
1013

1114
- `sentry-expo-upload-sourcemaps` no longer requires Sentry url when uploading sourcemaps to `sentry.io` ([#3915](https://github.com/getsentry/sentry-react-native/pull/3915))
1215

1316
### Dependencies
1417

15-
- Bump Cocoa SDK from v8.29.1 to v8.30.0 ([#3914](https://github.com/getsentry/sentry-react-native/pull/3914))
18+
- Bump Cocoa SDK from v8.25.0-alpha.0 to v8.30.0 ([#3914](https://github.com/getsentry/sentry-react-native/pull/3914))
1619
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8300)
17-
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.29.1...8.30.0)
20+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.25.0-alpha.0...8.30.0)
21+
- Bump Android SDK from v7.9.0-alpha.1 to v7.11.0-alpha.2 ([#3830](https://github.com/getsentry/sentry-react-native/pull/3830))
22+
- [changelog](https://github.com/getsentry/sentry-java/blob/7.11.0-alpha.2/CHANGELOG.md#7110-alpha2)
23+
- [diff](https://github.com/getsentry/sentry-java/compare/7.9.0-alpha.1...7.11.0-alpha.2)
24+
25+
Access to Mobile Replay is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)
1826

1927
## 5.24.1
2028

@@ -115,6 +123,14 @@ This release does *not* build on iOS. Please use `5.23.1` or newer.
115123
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8270)
116124
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.26.0...8.27.0)
117125

126+
## 5.23.0-alpha.1
127+
128+
### Fixes
129+
130+
- Pass `replaysSessionSampleRate` option to Android ([#3714](https://github.com/getsentry/sentry-react-native/pull/3714))
131+
132+
Access to Mobile Replay is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)
133+
118134
## 5.22.3
119135

120136
### Fixes
@@ -148,6 +164,47 @@ This release does *not* build on iOS. Please use `5.23.1` or newer.
148164
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8250)
149165
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.24.0...8.25.0)
150166

167+
## 5.23.0-alpha.0
168+
169+
### Features
170+
171+
- Mobile Session Replay Alpha ([#3714](https://github.com/getsentry/sentry-react-native/pull/3714))
172+
173+
To enable Replay for React Native on mobile and web add the following options.
174+
175+
```js
176+
Sentry.init({
177+
_experiments: {
178+
replaysSessionSampleRate: 1.0,
179+
replaysOnErrorSampleRate: 1.0,
180+
},
181+
});
182+
```
183+
184+
To change the default Mobile Replay options add the `mobileReplayIntegration`.
185+
186+
```js
187+
Sentry.init({
188+
_experiments: {
189+
replaysSessionSampleRate: 1.0,
190+
replaysOnErrorSampleRate: 1.0,
191+
},
192+
integration: [
193+
Sentry.mobileReplayIntegration({
194+
maskAllText: true,
195+
maskAllImages: true,
196+
}),
197+
],
198+
});
199+
```
200+
201+
Access is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)
202+
203+
### Dependencies
204+
205+
- Bump Cocoa SDK to [8.25.0-alpha.0](https://github.com/getsentry/sentry-cocoa/releases/tag/8.25.0-alpha.0)
206+
- Bump Android SDK to [7.9.0-alpha.1](https://github.com/getsentry/sentry-java/releases/tag/7.9.0-alpha.1)
207+
151208
## 5.22.0
152209

153210
### Features
@@ -658,7 +715,7 @@ This release is compatible with `[email protected]` and newer.
658715
});
659716
```
660717

661-
Read more at https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7690
718+
Read more at <https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7690>
662719

663720
- Report current screen in `contexts.app.view_names` ([#3339](https://github.com/getsentry/sentry-react-native/pull/3339))
664721

@@ -2697,7 +2754,7 @@ We are looking into ways making this more stable and plan to re-enable it again
26972754

26982755
## v0.23.2
26992756

2700-
- Fixed #228 again ¯\\_(ツ)_
2757+
- Fixed #228 again ¯\\*(ツ)*
27012758

27022759
## v0.23.1
27032760

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package io.sentry.rnsentryandroidtester
2+
3+
import io.sentry.Breadcrumb
4+
import io.sentry.react.RNSentryReplayBreadcrumbConverter
5+
import org.junit.Assert.assertEquals
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
import org.junit.runners.JUnit4
9+
10+
@RunWith(JUnit4::class)
11+
class RNSentryReplayBreadcrumbConverterTest {
12+
13+
@Test
14+
fun doesNotConvertSentryEventBreadcrumb() {
15+
val converter = RNSentryReplayBreadcrumbConverter()
16+
val testBreadcrumb = Breadcrumb();
17+
testBreadcrumb.category = "sentry.event"
18+
val actual = converter.convert(testBreadcrumb)
19+
assertEquals(null, actual)
20+
}
21+
22+
@Test
23+
fun doesNotConvertSentryTransactionBreadcrumb() {
24+
val converter = RNSentryReplayBreadcrumbConverter()
25+
val testBreadcrumb = Breadcrumb();
26+
testBreadcrumb.category = "sentry.transaction"
27+
val actual = converter.convert(testBreadcrumb)
28+
assertEquals(null, actual)
29+
}
30+
31+
@Test
32+
fun doesNotConvertNullPath() {
33+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(null)
34+
assertEquals(null, actual)
35+
}
36+
37+
@Test
38+
fun doesNotConvertPathContainingNull() {
39+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(arrayListOf(arrayOfNulls<Any>(1)))
40+
assertEquals(null, actual)
41+
}
42+
43+
@Test
44+
fun doesNotConvertPathWithValuesMissingNameAndLevel() {
45+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(arrayListOf(mapOf(
46+
"element" to "element4",
47+
"file" to "file4")))
48+
assertEquals(null, actual)
49+
}
50+
51+
@Test
52+
fun doesConvertValidPathExample1() {
53+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(listOf(
54+
mapOf("label" to "label0"),
55+
mapOf("name" to "name1"),
56+
mapOf("name" to "item2", "label" to "label2"),
57+
mapOf("name" to "item3", "label" to "label3", "element" to "element3"),
58+
mapOf("name" to "item4", "label" to "label4", "file" to "file4"),
59+
mapOf("name" to "item5", "label" to "label5", "element" to "element5", "file" to "file5")))
60+
assertEquals("label3(element3) > label2 > name1 > label0", actual)
61+
}
62+
63+
@Test
64+
fun doesConvertValidPathExample2() {
65+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(listOf(
66+
mapOf("name" to "item2", "label" to "label2"),
67+
mapOf("name" to "item3", "label" to "label3", "element" to "element3"),
68+
mapOf("name" to "item4", "label" to "label4", "file" to "file4"),
69+
mapOf("name" to "item5", "label" to "label5", "element" to "element5", "file" to "file5"),
70+
mapOf("label" to "label6"),
71+
mapOf("name" to "name7")))
72+
assertEquals("label5(element5, file5) > label4(file4) > label3(element3) > label2", actual)
73+
}
74+
}

RNSentryCocoaTester/RNSentryCocoaTester.xcodeproj/project.pbxproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
330F308C2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 330F308B2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m */; };
11+
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */; };
1112
33958C692BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33958C682BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m */; };
1213
33AFDFED2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AFDFEC2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m */; };
1314
33AFDFF12B8D15E500AAB120 /* RNSentryDependencyContainerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AFDFF02B8D15E500AAB120 /* RNSentryDependencyContainerTests.m */; };
@@ -19,6 +20,9 @@
1920
1482D5685A340AB93348A43D /* Pods-RNSentryCocoaTesterTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNSentryCocoaTesterTests.release.xcconfig"; path = "Target Support Files/Pods-RNSentryCocoaTesterTests/Pods-RNSentryCocoaTesterTests.release.xcconfig"; sourceTree = "<group>"; };
2021
330F308B2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNSentryBreadcrumbTests.m; sourceTree = "<group>"; };
2122
330F308D2C0F385A002A0D4E /* RNSentryBreadcrumb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryBreadcrumb.h; path = ../ios/RNSentryBreadcrumb.h; sourceTree = "<group>"; };
23+
336084372C32E382008CC412 /* RNSentryCocoaTesterTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNSentryCocoaTesterTests-Bridging-Header.h"; sourceTree = "<group>"; };
24+
336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RNSentryReplayBreadcrumbConverterTests.swift; sourceTree = "<group>"; };
25+
3360843A2C32E3A8008CC412 /* RNSentryReplayBreadcrumbConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryReplayBreadcrumbConverter.h; path = ../ios/RNSentryReplayBreadcrumbConverter.h; sourceTree = "<group>"; };
2226
3360898D29524164007C7730 /* RNSentryCocoaTesterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNSentryCocoaTesterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2327
338739072A7D7D2800950DDD /* RNSentryTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNSentryTests.h; sourceTree = "<group>"; };
2428
33958C672BFCEF5A00AD1FB6 /* RNSentryOnDrawReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryOnDrawReporter.h; path = ../ios/RNSentryOnDrawReporter.h; sourceTree = "<group>"; };
@@ -76,6 +80,7 @@
7680
3360899029524164007C7730 /* RNSentryCocoaTesterTests */ = {
7781
isa = PBXGroup;
7882
children = (
83+
336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */,
7984
33F58ACF2977037D008F60EA /* RNSentryTests.mm */,
8085
338739072A7D7D2800950DDD /* RNSentryTests.h */,
8186
33AFDFEC2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m */,
@@ -84,13 +89,15 @@
8489
33AFDFF22B8D15F600AAB120 /* RNSentryDependencyContainerTests.h */,
8590
33958C682BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m */,
8691
330F308B2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m */,
92+
336084372C32E382008CC412 /* RNSentryCocoaTesterTests-Bridging-Header.h */,
8793
);
8894
path = RNSentryCocoaTesterTests;
8995
sourceTree = "<group>";
9096
};
9197
33AFE0122B8F319000AAB120 /* RNSentry */ = {
9298
isa = PBXGroup;
9399
children = (
100+
3360843A2C32E3A8008CC412 /* RNSentryReplayBreadcrumbConverter.h */,
94101
330F308D2C0F385A002A0D4E /* RNSentryBreadcrumb.h */,
95102
33958C672BFCEF5A00AD1FB6 /* RNSentryOnDrawReporter.h */,
96103
33AFE0132B8F31AF00AAB120 /* RNSentryDependencyContainer.h */,
@@ -134,10 +141,12 @@
134141
isa = PBXProject;
135142
attributes = {
136143
BuildIndependentTargetsInParallel = 1;
144+
LastSwiftUpdateCheck = 1540;
137145
LastUpgradeCheck = 1420;
138146
TargetAttributes = {
139147
3360898C29524164007C7730 = {
140148
CreatedOnToolsVersion = 14.2;
149+
LastSwiftMigration = 1540;
141150
};
142151
};
143152
};
@@ -207,6 +216,7 @@
207216
buildActionMask = 2147483647;
208217
files = (
209218
33AFDFF12B8D15E500AAB120 /* RNSentryDependencyContainerTests.m in Sources */,
219+
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */,
210220
33F58AD02977037D008F60EA /* RNSentryTests.mm in Sources */,
211221
33958C692BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m in Sources */,
212222
330F308C2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m in Sources */,
@@ -333,6 +343,7 @@
333343
isa = XCBuildConfiguration;
334344
baseConfigurationReference = E2321E7CFA55AB617247098E /* Pods-RNSentryCocoaTesterTests.debug.xcconfig */;
335345
buildSettings = {
346+
CLANG_ENABLE_MODULES = YES;
336347
CODE_SIGN_STYLE = Automatic;
337348
CURRENT_PROJECT_VERSION = 1;
338349
GENERATE_INFOPLIST_FILE = YES;
@@ -387,6 +398,9 @@
387398
SUPPORTS_MACCATALYST = NO;
388399
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
389400
SWIFT_EMIT_LOC_STRINGS = NO;
401+
SWIFT_OBJC_BRIDGING_HEADER = "RNSentryCocoaTesterTests/RNSentryCocoaTesterTests-Bridging-Header.h";
402+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
403+
SWIFT_VERSION = 5.0;
390404
TARGETED_DEVICE_FAMILY = 1;
391405
};
392406
name = Debug;
@@ -395,6 +409,7 @@
395409
isa = XCBuildConfiguration;
396410
baseConfigurationReference = 1482D5685A340AB93348A43D /* Pods-RNSentryCocoaTesterTests.release.xcconfig */;
397411
buildSettings = {
412+
CLANG_ENABLE_MODULES = YES;
398413
CODE_SIGN_STYLE = Automatic;
399414
CURRENT_PROJECT_VERSION = 1;
400415
GENERATE_INFOPLIST_FILE = YES;
@@ -449,6 +464,8 @@
449464
SUPPORTS_MACCATALYST = NO;
450465
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
451466
SWIFT_EMIT_LOC_STRINGS = NO;
467+
SWIFT_OBJC_BRIDGING_HEADER = "RNSentryCocoaTesterTests/RNSentryCocoaTesterTests-Bridging-Header.h";
468+
SWIFT_VERSION = 5.0;
452469
TARGETED_DEVICE_FAMILY = 1;
453470
};
454471
name = Release;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
5+
#import "RNSentryReplayBreadcrumbConverter.h"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import XCTest
2+
3+
final class RNSentryReplayBreadcrumbConverterTests: XCTestCase {
4+
5+
func testNotConvertSentryEventBreadcrumb() {
6+
let converter = RNSentryReplayBreadcrumbConverter()
7+
let testBreadcrumb = Breadcrumb()
8+
testBreadcrumb.category = "sentry.event"
9+
let actual = converter.convert(from: testBreadcrumb)
10+
XCTAssertNil(actual)
11+
}
12+
13+
func testNotConvertSentryTransactionBreadcrumb() {
14+
let converter = RNSentryReplayBreadcrumbConverter()
15+
let testBreadcrumb = Breadcrumb()
16+
testBreadcrumb.category = "sentry.transaction"
17+
let actual = converter.convert(from: testBreadcrumb)
18+
XCTAssertNil(actual)
19+
}
20+
21+
func testTouchMessageReturnsNilOnEmptyArray() throws {
22+
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: [])
23+
XCTAssertEqual(actual, nil);
24+
}
25+
26+
func testTouchMessageReturnsNilOnNilArray() throws {
27+
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: nil as [Any]?)
28+
XCTAssertEqual(actual, nil);
29+
}
30+
31+
func testTouchMessageReturnsNilOnMissingNameAndLevel() throws {
32+
let testPath: [Any?] = [["element": "element4", "file": "file4"]]
33+
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: testPath as [Any])
34+
XCTAssertEqual(actual, nil);
35+
}
36+
37+
func testTouchMessageReturnsMessageOnValidPathExample1() throws {
38+
let testPath: [Any?] = [
39+
["label": "label0"],
40+
["name": "name1"],
41+
["name": "item2", "label": "label2"],
42+
["name": "item3", "label": "label3", "element": "element3"],
43+
["name": "item4", "label": "label4", "file": "file4"],
44+
["name": "item5", "label": "label5", "element": "element5", "file": "file5"],
45+
]
46+
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: testPath as [Any])
47+
XCTAssertEqual(actual, "label3(element3) > label2 > name1 > label0");
48+
}
49+
50+
func testTouchMessageReturnsMessageOnValidPathExample2() throws {
51+
let testPath: [Any?] = [
52+
["name": "item2", "label": "label2"],
53+
["name": "item3", "label": "label3", "element": "element3"],
54+
["name": "item4", "label": "label4", "file": "file4"],
55+
["name": "item5", "label": "label5", "element": "element5", "file": "file5"],
56+
["label": "label6"],
57+
["name": "name7"],
58+
]
59+
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: testPath as [Any])
60+
XCTAssertEqual(actual, "label5(element5, file5) > label4(file4) > label3(element3) > label2");
61+
}
62+
63+
}

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ android {
5454

5555
dependencies {
5656
implementation 'com.facebook.react:react-native:+'
57-
api 'io.sentry:sentry-android:7.10.0'
57+
api 'io.sentry:sentry-android:7.11.0-alpha.2'
5858
}

0 commit comments

Comments
 (0)