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 SentryMask and SentryUnmask iOS components #4224

Merged
merged 45 commits into from
Nov 25, 2024

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Oct 31, 2024

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This PR adds custom redact/mask components for iOS.

The implementation includes noop fallback for Android and other unsupported platforms and fallback Web implementation. These will be added in a follow up PRs.

import * as Sentry from '@sentry/react-native'

const Example = () => (
  <View>
    <Sentry.Unmask>
      <Text>This is unmasked because it's direct child of Sentry.Unmask (can be masked if Sentry.Masked is used higher in the hierarchy)</Text>
      <Sentry.Mask>
        <Text>This is masked always because it's a child of a Sentry.Mask</Text>
        <Sentry.Unmask>
          {/* Sentry.Unmask does not override the Sentry.Mask from above in the hierarchy */}
          <Text>This is masked always because it's a child of Sentry.Mask</Text>
        </Sentry.Unmask>
      </Sentry.Mask>
    </Sentry.Unmask>
  </View>
);
Device Replay
Screenshot 2024-11-11 at 16 24 03 Screenshot 2024-11-11 at 16 24 41

Todo

Preview Give feedback

💡 Motivation and Context

This is a part of RN Replay GA tasks

💚 How did you test it?

ci, local,

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Oct 31, 2024

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

Generated by 🚫 dangerJS against 9b8c546

Copy link
Contributor

github-actions bot commented Oct 31, 2024

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 503.55 ms 517.79 ms 14.24 ms
Size 17.74 MiB 20.08 MiB 2.35 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8ae23a7 526.83 ms 513.38 ms -13.45 ms
4297324 536.61 ms 542.48 ms 5.87 ms
dadc233+dirty 333.78 ms 343.94 ms 10.16 ms
c2a4e9b 480.42 ms 485.60 ms 5.18 ms
9433f35 347.64 ms 356.22 ms 8.58 ms
9a3ca65+dirty 326.93 ms 330.14 ms 3.21 ms
7bc4d75 488.76 ms 473.28 ms -15.48 ms
0d3e677 422.82 ms 411.90 ms -10.92 ms
80b2ce3 385.02 ms 387.36 ms 2.34 ms
1d86dd6 405.14 ms 411.06 ms 5.92 ms

App size

Revision Plain With Sentry Diff
8ae23a7 17.74 MiB 20.07 MiB 2.34 MiB
4297324 17.74 MiB 20.08 MiB 2.34 MiB
dadc233+dirty 17.73 MiB 19.75 MiB 2.02 MiB
c2a4e9b 17.73 MiB 20.06 MiB 2.33 MiB
9433f35 17.73 MiB 19.81 MiB 2.08 MiB
9a3ca65+dirty 17.73 MiB 20.04 MiB 2.31 MiB
7bc4d75 17.74 MiB 20.08 MiB 2.34 MiB
0d3e677 17.74 MiB 20.07 MiB 2.34 MiB
80b2ce3 17.73 MiB 19.75 MiB 2.02 MiB
1d86dd6 17.73 MiB 19.86 MiB 2.12 MiB

Copy link
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1227.00 ms 1238.17 ms 11.17 ms
Size 2.92 MiB 3.64 MiB 743.77 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
12427f4+dirty 1224.90 ms 1231.40 ms 6.50 ms
5446992+dirty 1249.94 ms 1254.80 ms 4.86 ms
e73d82f+dirty 1231.20 ms 1228.81 ms -2.40 ms
148f924+dirty 1220.72 ms 1221.30 ms 0.58 ms
fe13591+dirty 1250.69 ms 1246.27 ms -4.43 ms
1faf8e3+dirty 1223.38 ms 1220.56 ms -2.82 ms
484813b+dirty 1225.07 ms 1221.00 ms -4.07 ms
4a6664f+dirty 1218.77 ms 1221.07 ms 2.30 ms
e5bc97b+dirty 1229.17 ms 1227.64 ms -1.54 ms
15c80ab+dirty 1248.41 ms 1251.24 ms 2.83 ms

App size

Revision Plain With Sentry Diff
12427f4+dirty 2.92 MiB 3.44 MiB 533.29 KiB
5446992+dirty 2.92 MiB 3.44 MiB 535.26 KiB
e73d82f+dirty 2.92 MiB 3.64 MiB 740.56 KiB
148f924+dirty 2.92 MiB 3.60 MiB 701.88 KiB
fe13591+dirty 2.92 MiB 3.66 MiB 757.71 KiB
1faf8e3+dirty 2.92 MiB 3.64 MiB 742.61 KiB
484813b+dirty 2.92 MiB 3.64 MiB 740.56 KiB
4a6664f+dirty 2.92 MiB 3.60 MiB 702.09 KiB
e5bc97b+dirty 2.92 MiB 3.66 MiB 758.40 KiB
15c80ab+dirty 2.92 MiB 3.39 MiB 481.56 KiB

Copy link
Contributor

github-actions bot commented Oct 31, 2024

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1229.30 ms 1219.73 ms -9.56 ms
Size 2.36 MiB 3.10 MiB 759.68 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e2b64fe+dirty 1232.22 ms 1255.20 ms 22.98 ms
4cc5c27+dirty 1211.45 ms 1214.60 ms 3.16 ms
1c65324+dirty 1235.17 ms 1235.08 ms -0.09 ms
cdf2f33+dirty 1227.71 ms 1233.94 ms 6.22 ms
e1ea4a8+dirty 1233.49 ms 1237.71 ms 4.22 ms
dadc233+dirty 1223.20 ms 1236.88 ms 13.68 ms
ed3d77e+dirty 1214.61 ms 1205.83 ms -8.78 ms
2ec71da+dirty 1225.85 ms 1231.57 ms 5.72 ms
9cd0e9f+dirty 1224.94 ms 1239.88 ms 14.94 ms
0db0c72+dirty 1275.02 ms 1285.84 ms 10.82 ms

App size

Revision Plain With Sentry Diff
e2b64fe+dirty 2.36 MiB 2.85 MiB 495.80 KiB
4cc5c27+dirty 2.36 MiB 3.04 MiB 698.52 KiB
1c65324+dirty 2.36 MiB 3.04 MiB 698.64 KiB
cdf2f33+dirty 2.36 MiB 3.10 MiB 751.38 KiB
e1ea4a8+dirty 2.36 MiB 3.10 MiB 752.31 KiB
dadc233+dirty 2.36 MiB 2.84 MiB 486.85 KiB
ed3d77e+dirty 2.36 MiB 3.10 MiB 753.32 KiB
2ec71da+dirty 2.36 MiB 3.13 MiB 784.66 KiB
9cd0e9f+dirty 2.36 MiB 3.08 MiB 735.56 KiB
0db0c72+dirty 2.36 MiB 2.84 MiB 487.01 KiB

@krystofwoldrich krystofwoldrich changed the base branch from main to kw/fix/type-check November 6, 2024 15:21
Base automatically changed from kw/fix/type-check to main November 6, 2024 16:35
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 385.81 ms 446.46 ms 60.65 ms
Size 7.15 MiB 8.37 MiB 1.22 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d43a46b+dirty 417.65 ms 472.98 ms 55.33 ms
4297324+dirty 385.33 ms 435.68 ms 50.35 ms
13f280b+dirty 376.13 ms 406.41 ms 30.28 ms
dadc233+dirty 363.19 ms 370.37 ms 7.18 ms
9a3ca65+dirty 344.96 ms 358.92 ms 13.96 ms
e2b64fe+dirty 258.82 ms 304.26 ms 45.44 ms
8ae23a7+dirty 398.10 ms 411.48 ms 13.38 ms
27ef4ee+dirty 296.71 ms 351.00 ms 54.29 ms
eb1e19f+dirty 391.37 ms 418.27 ms 26.90 ms
86d6d2c+dirty 267.21 ms 325.24 ms 58.04 ms

App size

Revision Plain With Sentry Diff
d43a46b+dirty 7.15 MiB 8.34 MiB 1.19 MiB
4297324+dirty 7.15 MiB 8.35 MiB 1.20 MiB
13f280b+dirty 7.15 MiB 8.35 MiB 1.20 MiB
dadc233+dirty 7.15 MiB 8.04 MiB 910.84 KiB
9a3ca65+dirty 7.15 MiB 8.09 MiB 962.83 KiB
e2b64fe+dirty 7.15 MiB 8.07 MiB 947.16 KiB
8ae23a7+dirty 7.15 MiB 8.35 MiB 1.20 MiB
27ef4ee+dirty 7.15 MiB 8.08 MiB 959.49 KiB
eb1e19f+dirty 7.15 MiB 8.35 MiB 1.20 MiB
86d6d2c+dirty 7.15 MiB 8.09 MiB 962.69 KiB

@krystofwoldrich krystofwoldrich changed the base branch from main to 6.3.0-beta November 25, 2024 11:01
@krystofwoldrich
Copy link
Member Author

@antonis @lucas-zimerman This is ready for a review.

Since last review, the main change is in reverting shipping the TS source for RN Codegen and instead using NativeComponentsRegistry. eb457fc

Since this will be the first time we ship new architecture compatible components, this will first be released as beta (likely 6.4.0-beta.1)

CHANGELOG.md Outdated Show resolved Hide resolved
Base automatically changed from 6.3.0-beta to main November 25, 2024 11:48
@lucas-zimerman
Copy link
Collaborator

Lint seems to not be working

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

Overall, the PR looks good! but before merging, build/lint tests should pass, unless the issue is unrelated to the PR

Copy link
Collaborator

@antonis antonis left a comment

Choose a reason for hiding this comment

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

Apart from the lint issue the PR LGTM and works as expected 🎉

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

LGTM!

@krystofwoldrich krystofwoldrich enabled auto-merge (squash) November 25, 2024 16:41
@krystofwoldrich krystofwoldrich merged commit 07257af into main Nov 25, 2024
53 of 54 checks passed
@krystofwoldrich krystofwoldrich deleted the kw/feat/replay-custom-redact-components branch November 25, 2024 16:44
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.

3 participants