Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replay): Add network breadcrumbs #3912

Merged
merged 42 commits into from
Jun 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
66b14d8
touch events on android
vaind May 31, 2024
a9139c6
fix touchevent tests
vaind Jun 3, 2024
fb1bb90
Update android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumb…
vaind Jun 4, 2024
e725aa9
ios breadcrumb converter
vaind Jun 5, 2024
d5c8e67
delegate to default breadcrumb converter
vaind Jun 10, 2024
3d76fae
fix: module access
vaind Jun 11, 2024
9092169
Merge branch 'feat/replay' into feat/replay-breadcrumbs
vaind Jun 18, 2024
b4a1d8f
move replay stuff to RNSentrySessionReplay
vaind Jun 19, 2024
2ebf638
move setBreadcrumbConverter to init
vaind Jun 19, 2024
0f17b72
try to fix CI
vaind Jun 19, 2024
ae558fe
navigation breadcrumbs
vaind Jun 19, 2024
04c5c9d
try to fix CI
vaind Jun 19, 2024
6211bbf
pin xcode to 15.4 for e2e and sample app builds
krystofwoldrich Jun 20, 2024
96c7aab
chore: update cocoa breadcrumb converter to match latest changes in t…
vaind Jun 24, 2024
1a13827
more updates based on upstream changes
vaind Jun 24, 2024
f7f722f
add(replay): Add network breadcrumbs
krystofwoldrich Jun 24, 2024
73664a0
fix text encoder and add ios conversion
krystofwoldrich Jun 24, 2024
64482a2
fix cocoa conversion
krystofwoldrich Jun 24, 2024
1270935
add android conversion
krystofwoldrich Jun 24, 2024
af1d285
fix: data keys should be camel case
krystofwoldrich Jun 24, 2024
4150bea
fix export for tests
krystofwoldrich Jun 24, 2024
4d9d415
fix convertor rn convertor
krystofwoldrich Jun 25, 2024
b467133
refactor convertor, drop native navigation
krystofwoldrich Jun 25, 2024
5564c88
Revert "pin xcode to 15.4 for e2e and sample app builds"
krystofwoldrich Jun 25, 2024
8ce3ffb
Merge branch 'feat/replay-breadcrumbs' into kw/add-replay-network-bre…
krystofwoldrich Jun 25, 2024
db20918
add changelog
krystofwoldrich Jun 25, 2024
8d4f937
review changes
vaind Jun 25, 2024
272b4bb
fix changelog
vaind Jun 25, 2024
0a95f72
Merge branch 'feat/replay' into feat/replay-breadcrumbs
vaind Jun 26, 2024
30ed290
cleanup TODOs
vaind Jun 26, 2024
974961f
refactor replay network utils and add tests
krystofwoldrich Jun 26, 2024
89bf4ed
Merge remote-tracking branch 'origin/feat/replay-breadcrumbs' into kw…
krystofwoldrich Jun 26, 2024
f71fb66
touch event path for replay breadcrumbs
vaind Jun 26, 2024
2f2ff79
remove native navigation breadcrumbs on iOS
vaind Jun 26, 2024
dcc9753
renames
vaind Jun 26, 2024
a138db1
ignore native navigation breadcrumbs on android
vaind Jun 26, 2024
e3aaee8
fix android
vaind Jun 26, 2024
8c2383b
Merge remote-tracking branch 'origin/feat/replay-breadcrumbs' into kw…
krystofwoldrich Jun 26, 2024
56eb282
Merge remote-tracking branch 'origin/feat/replay' into kw/add-replay-…
krystofwoldrich Jun 27, 2024
ceb8122
Update src/js/replay/networkUtils.ts
krystofwoldrich Jun 27, 2024
18f51e1
Update src/js/replay/networkUtils.ts
krystofwoldrich Jun 27, 2024
2b5a2f4
fix java
krystofwoldrich Jun 27, 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
Next Next commit
touch events on android
  • Loading branch information
vaind committed Jun 4, 2024
commit 66b14d865df90e19e070b3b244e430b205163ece
3 changes: 3 additions & 0 deletions android/src/main/java/io/sentry/react/RNSentryModuleImpl.java
Original file line number Diff line number Diff line change
@@ -294,6 +294,9 @@ public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
}
});

Sentry.getCurrentHub().getOptions().getReplayController()
.setBreadcrumbConverter(new RNSentryReplayBreadcrumbConverter());

promise.resolve(true);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package io.sentry.react;

import io.sentry.Breadcrumb;
import io.sentry.android.replay.DefaultReplayBreadcrumbConverter;
import io.sentry.rrweb.RRWebEvent;
import io.sentry.rrweb.RRWebBreadcrumbEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadcrumbConverter {
public RNSentryReplayBreadcrumbConverter() {
}

@Override
public @Nullable RRWebEvent convert(final @NotNull Breadcrumb breadcrumb) {
var rrwebBreadcrumb = new RRWebBreadcrumbEvent();
assert rrwebBreadcrumb.getCategory() == null;

if (breadcrumb.getCategory().equals("touch")) {
rrwebBreadcrumb.setCategory("ui.tap");
Object target = breadcrumb.getData("target");
if (target != null) {
rrwebBreadcrumb.setMessage(target.toString());
}
rrwebBreadcrumb.setData(breadcrumb.getData());
}

if (rrwebBreadcrumb.getCategory() != null && !rrwebBreadcrumb.getCategory().isEmpty()) {
rrwebBreadcrumb.setTimestamp(breadcrumb.getTimestamp().getTime());
rrwebBreadcrumb.setBreadcrumbTimestamp(breadcrumb.getTimestamp().getTime() / 1000.0);
rrwebBreadcrumb.setBreadcrumbType("default");
return rrwebBreadcrumb;
}

return super.convert(breadcrumb);
}
}
5 changes: 4 additions & 1 deletion src/js/touchevents.tsx
Original file line number Diff line number Diff line change
@@ -120,7 +120,10 @@ class TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {
const level = 'info' as SeverityLevel;
const crumb = {
category: this.props.breadcrumbCategory,
data: { componentTree: componentTreeNames },
data: {
componentTree: componentTreeNames,
...(activeLabel && { target: activeLabel }),
},
level: level,
message: activeLabel
? `Touch event within element: ${activeLabel}`