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 breadcrumbs mapping from RN to RRWeb format #3846

Merged
merged 25 commits into from
Jun 26, 2024

Conversation

vaind
Copy link
Collaborator

@vaind vaind commented May 31, 2024

Copy link
Contributor

github-actions bot commented May 31, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e3aaee8

@vaind vaind changed the title feat(replay): Add Mobile Replay Alpha (#3714) feat(replay): Add breadcrumbs mapping from RN to RRWeb format May 31, 2024
RNSentry.podspec Outdated Show resolved Hide resolved
@vaind
Copy link
Collaborator Author

vaind commented Jun 18, 2024

I've updated the base replay PR and this one with the latest changes from main & tested this manually. Everything seems to work as expected.

  1. Are there device integration tests this should be added to?
  2. do you want to merge this or feat: touch breadcrumbs info improvements #3899 first?

@vaind vaind marked this pull request as ready for review June 18, 2024 18:39
Copy link
Contributor

github-actions bot commented Jun 18, 2024

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 448.46 ms 478.28 ms 29.82 ms
Size 17.73 MiB 20.04 MiB 2.30 MiB

Baseline results on branch: feat/replay

Startup times

Revision Plain With Sentry Diff
41db11d 429.33 ms 451.24 ms 21.91 ms

App size

Revision Plain With Sentry Diff
41db11d 17.73 MiB 20.04 MiB 2.30 MiB

Previous results on branch: feat/replay-breadcrumbs

Startup times

Revision Plain With Sentry Diff
9afd1d1 458.68 ms 478.26 ms 19.57 ms
5aeaa1a 435.25 ms 454.86 ms 19.61 ms
8d0724c 393.89 ms 455.47 ms 61.58 ms
46a7238 394.98 ms 429.48 ms 34.50 ms

App size

Revision Plain With Sentry Diff
9afd1d1 17.73 MiB 20.04 MiB 2.30 MiB
5aeaa1a 17.73 MiB 20.04 MiB 2.30 MiB
8d0724c 17.73 MiB 20.04 MiB 2.30 MiB
46a7238 17.73 MiB 20.04 MiB 2.30 MiB

Copy link
Contributor

github-actions bot commented Jun 18, 2024

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1241.55 ms 1231.37 ms -10.18 ms
Size 2.36 MiB 3.05 MiB 701.85 KiB

Baseline results on branch: feat/replay

Startup times

Revision Plain With Sentry Diff
41db11d+dirty 1207.36 ms 1210.32 ms 2.96 ms

App size

Revision Plain With Sentry Diff
41db11d+dirty 2.36 MiB 3.04 MiB 698.69 KiB

Previous results on branch: feat/replay-breadcrumbs

Startup times

Revision Plain With Sentry Diff
8d0724c+dirty 1219.06 ms 1212.34 ms -6.72 ms
5aeaa1a+dirty 1209.26 ms 1212.90 ms 3.64 ms
46a7238+dirty 1224.98 ms 1237.22 ms 12.25 ms
9afd1d1+dirty 1246.31 ms 1244.80 ms -1.51 ms

App size

Revision Plain With Sentry Diff
8d0724c+dirty 2.36 MiB 3.05 MiB 701.22 KiB
5aeaa1a+dirty 2.36 MiB 3.05 MiB 701.67 KiB
46a7238+dirty 2.36 MiB 3.05 MiB 701.62 KiB
9afd1d1+dirty 2.36 MiB 3.05 MiB 701.17 KiB

Copy link
Contributor

github-actions bot commented Jun 18, 2024

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1230.37 ms 1221.06 ms -9.30 ms
Size 2.92 MiB 3.61 MiB 708.90 KiB

Baseline results on branch: feat/replay

Startup times

Revision Plain With Sentry Diff
41db11d+dirty 1208.60 ms 1210.47 ms 1.87 ms

App size

Revision Plain With Sentry Diff
41db11d+dirty 2.92 MiB 3.61 MiB 705.84 KiB

Previous results on branch: feat/replay-breadcrumbs

Startup times

Revision Plain With Sentry Diff
8d0724c+dirty 1214.55 ms 1216.37 ms 1.82 ms
5aeaa1a+dirty 1211.06 ms 1210.47 ms -0.59 ms
46a7238+dirty 1234.27 ms 1228.81 ms -5.45 ms
9afd1d1+dirty 1241.30 ms 1238.83 ms -2.46 ms

App size

Revision Plain With Sentry Diff
8d0724c+dirty 2.92 MiB 3.61 MiB 708.14 KiB
5aeaa1a+dirty 2.92 MiB 3.61 MiB 708.64 KiB
46a7238+dirty 2.92 MiB 3.61 MiB 708.49 KiB
9afd1d1+dirty 2.92 MiB 3.61 MiB 708.07 KiB

@krystofwoldrich
Copy link
Member

@vaind

Are there device integration tests this should be added to?

There are no device integration tests for RN Replay, yet.

do you want to merge this or #3899 first?

Both ways is fine, this goes to replay branch and the touch goes to main which we afterwards merge to replay branch.

@krystofwoldrich
Copy link
Member

Build legacy ios production dynamic-frameworks

[RNSentry] Write Auxiliary File RNSentry.LinkFileList
Error: Undefined symbols for architecture arm64
Error:   "_OBJC_CLASS_$__TtC6Sentry26SentryRRWebBreadcrumbEvent", referenced from:
Error:   "_OBJC_CLASS_$__TtC6Sentry34SentrySRDefaultBreadcrumbConverter", referenced from:
Error: ld: symbol(s) not found for architecture arm64
Error: clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: Process completed with exit code 65.

It looks like some of these classes are missing headers/or not included in the headers, the dynamic frameworks build fails.

@krystofwoldrich
Copy link
Member

Build legacy macos production no-frameworks

We need to guard these parts with #if SENTRY_HAS_UIKIT.

[RNSentry] Compiling RNSentrySessionReplay.m
Error: no known class method for selector 'configureSessionReplayWith:screenshotProvider:'
  [PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: Process completed with exit code 65.

@krystofwoldrich
Copy link
Member

We could add replays to our E2E tests -> #3902

@vaind
Copy link
Collaborator Author

vaind commented Jun 19, 2024

Build legacy ios production dynamic-frameworks

[RNSentry] Write Auxiliary File RNSentry.LinkFileList
Error: Undefined symbols for architecture arm64
Error:   "_OBJC_CLASS_$__TtC6Sentry26SentryRRWebBreadcrumbEvent", referenced from:
Error:   "_OBJC_CLASS_$__TtC6Sentry34SentrySRDefaultBreadcrumbConverter", referenced from:
Error: ld: symbol(s) not found for architecture arm64
Error: clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: Process completed with exit code 65.

It looks like some of these classes are missing headers/or not included in the headers, the dynamic frameworks build fails.

I've tried a couple of things to fix this but with no luck. the error only happens when building a dynamic framework. Shouldn't be because of missing includes because the error fails at link time, so it's the symbols that are missing.


Ld /Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/RNSentry/RNSentry.framework/RNSentry normal (in target 'RNSentry' from project 'Pods')
    cd /Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/Pods
    /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Xlinker -reproducible -target arm64-apple-ios13.4-simulator -dynamiclib -isysroot /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk -Os -L/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Intermediates.noindex/EagerLinkingTBDs/Release-iphonesimulator -L/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/RNSentry -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Intermediates.noindex/EagerLinkingTBDs/Release-iphonesimulator -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/RNSentry -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/DoubleConversion -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/RCT-Folly -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-Core -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-cxxreact -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-debug -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-hermes -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-jsi -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-jsiexecutor -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-jsinspector -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-logger -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-perflogger -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-rendererdebug -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-runtimescheduler -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/React-utils -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/Sentry -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/SocketRocket -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/Yoga -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/fmt -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/glog -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/libevent -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -filelist /Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/RNSentry.build/Objects-normal/arm64/RNSentry.LinkFileList -install_name @rpath/RNSentry.framework/RNSentry -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/RNSentry.build/Objects-normal/arm64/RNSentry_lto.o -Xlinker -objc_abi_version -Xlinker 2 -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -Wl -ld_classic -framework Foundation -framework JavaScriptCore -framework React -framework Sentry -framework hermes -framework reacthermes -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/RNSentry.build/Objects-normal/arm64/RNSentry_dependency_info.dat -o /Users/runner/work/sentry-react-native/sentry-react-native/test/react-native/versions/0.73.2/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator/RNSentry/RNSentry.framework/RNSentry
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$__TtC6Sentry26SentryRRWebBreadcrumbEvent", referenced from:
      objc-class-ref in RNSentryBreadcrumbConverter.o
  "_OBJC_CLASS_$__TtC6Sentry34SentrySRDefaultBreadcrumbConverter", referenced from:
      objc-class-ref in RNSentryBreadcrumbConverter.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Maybe @brustolin has an idea?

ios/RNSentry.mm Outdated Show resolved Hide resolved
ios/RNSentry.mm Outdated Show resolved Hide resolved
@krystofwoldrich
Copy link
Member

Let's add changelog.

@krystofwoldrich
Copy link
Member

https://github.com/getsentry/sentry-cocoa/releases/tag/8.30.0 includes the needed changes

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! Thank you!

ios/RNSentryBreadcrumbConverter.m Outdated Show resolved Hide resolved
Comment on lines +23 to +45
ArrayList path = (ArrayList) breadcrumb.getData("path");
if (path != null) {
StringBuilder message = new StringBuilder();
for (int i = Math.min(3, path.size()); i >= 0; i--) {
HashMap item = (HashMap) path.get(i);
message.append(item.get("name"));
if (item.containsKey("element") || item.containsKey("file")) {
message.append('(');
if (item.containsKey("element")) {
message.append(item.get("element"));
if (item.containsKey("file")) {
message.append(", ");
message.append(item.get("file"));
}
} else if (item.containsKey("file")) {
message.append(item.get("file"));
}
message.append(')');
}
if (i > 0) {
message.append(" > ");
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good in the UI, let's leave it like this for now, in the Replay alpha branch.

We should discuss this with the front end as they can assemble the string from the structured data.

@krystofwoldrich krystofwoldrich merged commit 38d8d7c into feat/replay Jun 26, 2024
52 of 53 checks passed
@krystofwoldrich krystofwoldrich deleted the feat/replay-breadcrumbs branch June 26, 2024 14:55
bruno-garcia added a commit that referenced this pull request Jul 15, 2024
* feat(replay): Add Mobile Replay Alpha (#3714)

* feat(sample): add running indicator (animation overlay) (#3903)

* feat(replay): Add breadcrumbs mapping from RN to RRWeb format (#3846)

* feat(replay): Add network breadcrumbs (#3912)

* fix(replay): Add tests for touch events (#3924)

* feat(replay): Filter Sentry event breadcrumbs (#3925)

* fix(changelog): Add latest native SDKs details

* release: 5.25.0-alpha.2

* misc(samples): Add console anything examples for replay testing (#3928)

* feat: Add Sentry Babel Transformer (#3916)

* fix(replay): Add app lifecycle breadcrumbs conversion tests (#3932)

* chore(deps): bump sentry-android to 7.12.0-alpha.3

* chore(deps): bump sentry-android to 7.12.0-alpha.4

* fix(replay): Mask SVGs from `react-native-svg` when `maskAllVectors=true` (#3930)

* fix(replay): Add missing properties to android nav breadcrumbs (#3942)

* release: 5.26.0-alpha.3

* misc(replay): Add Mobile Replay Public Beta changelog (#3943)

---------

Co-authored-by: Ivan Dlugos <6349682+vaind@users.noreply.github.com>
Co-authored-by: Ivan Dlugos <dlugos.ivan@gmail.com>
Co-authored-by: getsentry-bot <bot@sentry.io>
Co-authored-by: getsentry-bot <bot@getsentry.com>
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants