Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
60d07df
feat(replay): Add Mobile Replay Alpha (#3714)
krystofwoldrich May 21, 2024
41f816a
Merge branch 'main' into feat/replay
vaind Jun 4, 2024
c3ff79f
Merge branch 'main' into feat/replay
vaind Jun 18, 2024
13a9360
feat(sample): add running indicator (animation overlay) (#3903)
krystofwoldrich Jun 21, 2024
1f1e41e
Merge branch 'main' into feat/replay
vaind Jun 26, 2024
38d8d7c
feat(replay): Add breadcrumbs mapping from RN to RRWeb format (#3846)
vaind Jun 26, 2024
ac72abc
feat(replay): Add network breadcrumbs (#3912)
krystofwoldrich Jun 27, 2024
5f3a5c8
fix(replay): Add tests for touch events (#3924)
krystofwoldrich Jul 2, 2024
b4aaa68
feat(replay): Filter Sentry event breadcrumbs (#3925)
krystofwoldrich Jul 2, 2024
00aa520
Merge branch 'main' into feat/replay
krystofwoldrich Jul 2, 2024
cfd5aee
fix(changelog): Add latest native SDKs details
krystofwoldrich Jul 2, 2024
83f5a0c
release: 5.25.0-alpha.2
getsentry-bot Jul 2, 2024
8e9c3a0
Merge branch 'release/5.25.0-alpha.2' into feat/replay
Jul 2, 2024
9672e88
misc(samples): Add console anything examples for replay testing (#3928)
krystofwoldrich Jul 3, 2024
6067ecc
feat: Add Sentry Babel Transformer (#3916)
krystofwoldrich Jul 3, 2024
3b28c40
fix(replay): Add app lifecycle breadcrumbs conversion tests (#3932)
krystofwoldrich Jul 5, 2024
e25da10
Merge remote-tracking branch 'origin/main' into feat/replay
krystofwoldrich Jul 9, 2024
6d8c4dd
chore(deps): bump sentry-android to 7.12.0-alpha.3
krystofwoldrich Jul 9, 2024
6fd2a34
chore(deps): bump sentry-android to 7.12.0-alpha.4
krystofwoldrich Jul 9, 2024
3dcf57b
fix(replay): Mask SVGs from `react-native-svg` when `maskAllVectors=t…
krystofwoldrich Jul 10, 2024
361867e
Merge remote-tracking branch 'origin/main' into feat/replay
krystofwoldrich Jul 10, 2024
f96cf53
Merge remote-tracking branch 'origin/main' into feat/replay
krystofwoldrich Jul 12, 2024
254b772
fix(replay): Add missing properties to android nav breadcrumbs (#3942)
krystofwoldrich Jul 12, 2024
7b9baca
release: 5.26.0-alpha.3
getsentry-bot Jul 12, 2024
222c9dd
Merge branch 'release/5.26.0-alpha.3' into feat/replay
Jul 12, 2024
0b74944
misc(replay): Add Mobile Replay Public Beta changelog (#3943)
krystofwoldrich Jul 15, 2024
4088ea8
Merge branch 'main' into feat/replay
romtsn Jul 15, 2024
a1da3bf
Merge branch 'main' into feat/replay
bruno-garcia Jul 15, 2024
b9a7f9d
Merge branch 'main' into feat/replay
bruno-garcia Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(replay): Filter Sentry event breadcrumbs (#3925)
  • Loading branch information
krystofwoldrich authored Jul 2, 2024
commit b4aaa682a855a86d38da9b0d76db9eaacde9fa63
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- 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))
- Add replay breadcrumbs for touch & navigation events ([#3846](https://github.com/getsentry/sentry-react-native/pull/3846))
- Add network data to Session Replays ([#3912](https://github.com/getsentry/sentry-react-native/pull/3912))
- Filter Sentry Event Breadcrumbs from Mobile Replays ([#3925](https://github.com/getsentry/sentry-react-native/pull/3925))

### Dependencies

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.rnsentryandroidtester

import io.sentry.Breadcrumb
import io.sentry.react.RNSentryReplayBreadcrumbConverter
import org.junit.Assert.assertEquals
import org.junit.Test
Expand All @@ -9,6 +10,24 @@ import org.junit.runners.JUnit4
@RunWith(JUnit4::class)
class RNSentryReplayBreadcrumbConverterTest {

@Test
fun doesNotConvertSentryEventBreadcrumb() {
val converter = RNSentryReplayBreadcrumbConverter()
val testBreadcrumb = Breadcrumb();
testBreadcrumb.category = "sentry.event"
val actual = converter.convert(testBreadcrumb)
assertEquals(null, actual)
}

@Test
fun doesNotConvertSentryTransactionBreadcrumb() {
val converter = RNSentryReplayBreadcrumbConverter()
val testBreadcrumb = Breadcrumb();
testBreadcrumb.category = "sentry.transaction"
val actual = converter.convert(testBreadcrumb)
assertEquals(null, actual)
}

@Test
fun doesNotConvertNullPath() {
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(null)
Expand Down Expand Up @@ -52,4 +71,4 @@ class RNSentryReplayBreadcrumbConverterTest {
mapOf("name" to "name7")))
assertEquals("label5(element5, file5) > label4(file4) > label3(element3) > label2", actual)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@ import XCTest

final class RNSentryReplayBreadcrumbConverterTests: XCTestCase {

func testNotConvertSentryEventBreadcrumb() {
let converter = RNSentryReplayBreadcrumbConverter()
let testBreadcrumb = Breadcrumb()
testBreadcrumb.category = "sentry.event"
let actual = converter.convert(from: testBreadcrumb)
XCTAssertNil(actual)
}

func testNotConvertSentryTransactionBreadcrumb() {
let converter = RNSentryReplayBreadcrumbConverter()
let testBreadcrumb = Breadcrumb()
testBreadcrumb.category = "sentry.transaction"
let actual = converter.convert(from: testBreadcrumb)
XCTAssertNil(actual)
}

func testTouchMessageReturnsNilOnEmptyArray() throws {
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: [])
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: [])
XCTAssertEqual(actual, nil);
}

func testTouchMessageReturnsNilOnNilArray() throws {
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: nil as [Any]?)
let actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(from: nil as [Any]?)
XCTAssertEqual(actual, nil);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public RNSentryReplayBreadcrumbConverter() {
return null;
}

// Do not add Sentry Event breadcrumbs to replay
if (breadcrumb.getCategory().equals("sentry.event") ||
breadcrumb.getCategory().equals("sentry.transaction")) {
return null;
}

if (breadcrumb.getCategory().equals("touch")) {
return convertTouchBreadcrumb(breadcrumb);
}
Expand Down
2 changes: 2 additions & 0 deletions ios/RNSentryReplayBreadcrumbConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@

+ (NSString* _Nullable) getTouchPathMessageFrom:(NSArray* _Nullable) path;

- (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull) breadcrumb;

@end
#endif
6 changes: 6 additions & 0 deletions ios/RNSentryReplayBreadcrumbConverter.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ - (instancetype _Nonnull)init {
(SentryBreadcrumb *_Nonnull)breadcrumb {
assert(breadcrumb.timestamp != nil);

if ([breadcrumb.category isEqualToString:@"sentry.event"] ||
[breadcrumb.category isEqualToString:@"sentry.transaction"]) {
// Do not add Sentry Event breadcrumbs to replay
return nil;
}

if ([breadcrumb.category isEqualToString:@"http"]) {
// Drop native network breadcrumbs to avoid duplicates
return nil;
Expand Down