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: custom replay masking rules #2324

Merged
merged 29 commits into from
Oct 10, 2024
Merged

feat: custom replay masking rules #2324

merged 29 commits into from
Oct 10, 2024

Conversation

vaind
Copy link
Collaborator

@vaind vaind commented Sep 30, 2024

📜 Description

  • refactor: change redaction logic to custom filters
  • refactor widget filter to handle errors gracefully
  • add an option to disable masking asset images
  • add new masking config class
  • expose masking configs to users

💡 Motivation and Context

part of #1193 (comment)

💚 How did you test it?

manually & unit tests

📝 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
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

I didn't want to do more than necessary in this PR but I think we should move the masking logic & widget filter out of the replay directory & move the configuration out of the replay configuration in order to support #1956

Copy link
Contributor

github-actions bot commented Sep 30, 2024

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

Generated by 🚫 dangerJS against be99d93

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 93.96552% with 7 lines in your changes missing coverage. Please review.

Project coverage is 85.04%. Comparing base (f333300) to head (be99d93).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
flutter/lib/src/sentry_replay_options.dart 86.84% 5 Missing ⚠️
flutter/lib/src/replay/widget_filter.dart 95.45% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2324      +/-   ##
==========================================
+ Coverage   84.59%   85.04%   +0.45%     
==========================================
  Files         250       79     -171     
  Lines        8985     2789    -6196     
==========================================
- Hits         7601     2372    -5229     
+ Misses       1384      417     -967     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Sep 30, 2024

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 445.42 ms 487.24 ms 41.82 ms
Size 6.49 MiB 7.56 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
280ab9f 316.46 ms 372.98 ms 56.52 ms
1e781fc 315.51 ms 383.76 ms 68.24 ms
3e9fb0e 329.14 ms 359.16 ms 30.02 ms
2e1e4ae 413.34 ms 509.24 ms 95.90 ms
b66cc27 493.11 ms 554.66 ms 61.55 ms
ad69abc 297.35 ms 385.89 ms 88.54 ms
c978477 347.00 ms 409.94 ms 62.94 ms
0a82a1e 321.02 ms 393.82 ms 72.80 ms
9d43f71 318.06 ms 370.38 ms 52.32 ms
cdf7172 348.54 ms 390.81 ms 42.27 ms

App size

Revision Plain With Sentry Diff
280ab9f 6.16 MiB 7.14 MiB 1010.85 KiB
1e781fc 6.06 MiB 7.03 MiB 995.72 KiB
3e9fb0e 5.94 MiB 6.95 MiB 1.01 MiB
2e1e4ae 6.35 MiB 7.42 MiB 1.06 MiB
b66cc27 6.49 MiB 7.56 MiB 1.07 MiB
ad69abc 6.06 MiB 7.09 MiB 1.03 MiB
c978477 6.33 MiB 7.29 MiB 987.32 KiB
0a82a1e 6.15 MiB 7.11 MiB 981.82 KiB
9d43f71 6.16 MiB 7.14 MiB 1011.26 KiB
cdf7172 5.94 MiB 6.95 MiB 1.01 MiB

Previous results on branch: feat/replay-custom-redact

Startup times

Revision Plain With Sentry Diff
1fe6f3f 489.11 ms 490.96 ms 1.85 ms
04805ce 469.45 ms 522.38 ms 52.93 ms
e2589f5 478.14 ms 522.92 ms 44.77 ms
118398e 509.73 ms 591.84 ms 82.10 ms
ec669f4 527.90 ms 598.52 ms 70.62 ms
f6fbf8a 471.17 ms 522.59 ms 51.42 ms
c1495e0 512.18 ms 598.63 ms 86.45 ms
e877795 493.65 ms 552.00 ms 58.35 ms
d0c56a3 448.94 ms 521.60 ms 72.66 ms

App size

Revision Plain With Sentry Diff
1fe6f3f 6.49 MiB 7.56 MiB 1.07 MiB
04805ce 6.49 MiB 7.56 MiB 1.07 MiB
e2589f5 6.49 MiB 7.56 MiB 1.07 MiB
118398e 6.49 MiB 7.56 MiB 1.07 MiB
ec669f4 6.49 MiB 7.56 MiB 1.07 MiB
f6fbf8a 6.49 MiB 7.56 MiB 1.07 MiB
c1495e0 6.49 MiB 7.56 MiB 1.07 MiB
e877795 6.49 MiB 7.56 MiB 1.07 MiB
d0c56a3 6.49 MiB 7.56 MiB 1.07 MiB

Copy link
Contributor

github-actions bot commented Sep 30, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1238.92 ms 1245.90 ms 6.98 ms
Size 8.38 MiB 9.74 MiB 1.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c978477 1228.43 ms 1249.17 ms 20.74 ms
25e9b59 1289.76 ms 1295.27 ms 5.51 ms
21845e2 1279.37 ms 1298.81 ms 19.45 ms
5e8d2b3 1255.71 ms 1267.98 ms 12.27 ms
6e083bb 1244.33 ms 1264.60 ms 20.26 ms
3ad66e4 1230.44 ms 1245.08 ms 14.65 ms
7ade5af 1296.24 ms 1297.43 ms 1.18 ms
a5031f1 1244.14 ms 1268.79 ms 24.64 ms
1a93825 1257.25 ms 1261.55 ms 4.30 ms
cdf7172 1264.43 ms 1291.39 ms 26.96 ms

App size

Revision Plain With Sentry Diff
c978477 8.32 MiB 9.50 MiB 1.18 MiB
25e9b59 8.16 MiB 9.15 MiB 1021.15 KiB
21845e2 8.15 MiB 9.12 MiB 991.34 KiB
5e8d2b3 8.29 MiB 9.36 MiB 1.07 MiB
6e083bb 8.16 MiB 9.17 MiB 1.01 MiB
3ad66e4 8.32 MiB 9.38 MiB 1.05 MiB
7ade5af 8.15 MiB 9.15 MiB 1015.93 KiB
a5031f1 8.32 MiB 9.50 MiB 1.18 MiB
1a93825 8.28 MiB 9.34 MiB 1.05 MiB
cdf7172 8.16 MiB 9.16 MiB 1.01 MiB

Previous results on branch: feat/replay-custom-redact

Startup times

Revision Plain With Sentry Diff
c1495e0 1217.90 ms 1250.37 ms 32.47 ms
534bbb4 1243.30 ms 1262.51 ms 19.21 ms
1fe6f3f 1241.96 ms 1273.18 ms 31.23 ms
e877795 1248.69 ms 1259.06 ms 10.37 ms
ec669f4 1238.29 ms 1259.86 ms 21.57 ms
d0c56a3 1243.22 ms 1245.48 ms 2.25 ms
f6fbf8a 1259.68 ms 1285.17 ms 25.49 ms
04805ce 1266.69 ms 1286.36 ms 19.67 ms
e2589f5 1251.92 ms 1276.73 ms 24.81 ms
118398e 1252.76 ms 1275.54 ms 22.79 ms

App size

Revision Plain With Sentry Diff
c1495e0 8.38 MiB 9.74 MiB 1.36 MiB
534bbb4 8.38 MiB 9.74 MiB 1.36 MiB
1fe6f3f 8.38 MiB 9.74 MiB 1.36 MiB
e877795 8.38 MiB 9.74 MiB 1.36 MiB
ec669f4 8.38 MiB 9.74 MiB 1.36 MiB
d0c56a3 8.38 MiB 9.74 MiB 1.36 MiB
f6fbf8a 8.38 MiB 9.74 MiB 1.36 MiB
04805ce 8.38 MiB 9.74 MiB 1.37 MiB
e2589f5 8.38 MiB 9.74 MiB 1.36 MiB
118398e 8.38 MiB 9.74 MiB 1.36 MiB

CHANGELOG.md Show resolved Hide resolved
flutter/lib/src/replay/masking_config.dart Show resolved Hide resolved
Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

👍 nice

@vaind
Copy link
Collaborator Author

vaind commented Oct 10, 2024

👍 nice

thanks for the review. I've noticed one important code branch is missing in tests so I've added it. Please have a look and feel free to merge if it looks good to you: be99d93 (#2324)

@buenaflor
Copy link
Contributor

additional test looks good, I'll merge this now.

CI is failing but that's because setup-java is having problems actions/setup-java#692

@buenaflor buenaflor merged commit e239c83 into main Oct 10, 2024
45 of 51 checks passed
@buenaflor buenaflor deleted the feat/replay-custom-redact branch October 10, 2024 19:05
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.

2 participants