Skip to content

Conversation

@buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Jun 13, 2025

📜 Description

Masks the SensitiveContent widget ootb for replay

💡 Motivation and Context

Closes #2987

💚 How did you test it?

📝 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

@codecov
Copy link

codecov bot commented Jun 13, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.21%. Comparing base (396cb30) to head (33b5751).

Files with missing lines Patch % Lines
...ckages/flutter/lib/src/sentry_privacy_options.dart 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2989      +/-   ##
==========================================
+ Coverage   87.02%   89.21%   +2.19%     
==========================================
  Files         134       99      -35     
  Lines        4964     3423    -1541     
==========================================
- Hits         4320     3054    -1266     
+ Misses        644      369     -275     

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1267.33 ms 1269.45 ms 2.12 ms
Size 5.53 MiB 6.01 MiB 488.60 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6f47800 1247.52 ms 1259.37 ms 11.85 ms
6bcdc99 1257.16 ms 1264.96 ms 7.79 ms
765aa8b 1259.09 ms 1269.90 ms 10.82 ms
73a3c38 1263.37 ms 1277.90 ms 14.53 ms
0fb45d0 1273.24 ms 1286.44 ms 13.19 ms
aeb02f2 1244.29 ms 1256.55 ms 12.26 ms
f761369 1261.69 ms 1277.82 ms 16.12 ms
0fb3800 1256.60 ms 1266.28 ms 9.68 ms
e04b24b 1230.22 ms 1233.90 ms 3.67 ms
1f639ee 1252.43 ms 1257.82 ms 5.38 ms

App size

Revision Plain With Sentry Diff
6f47800 7.86 MiB 9.44 MiB 1.58 MiB
6bcdc99 5.53 MiB 6.00 MiB 479.95 KiB
765aa8b 7.86 MiB 9.44 MiB 1.58 MiB
73a3c38 7.86 MiB 9.44 MiB 1.58 MiB
0fb45d0 7.86 MiB 9.44 MiB 1.58 MiB
aeb02f2 7.86 MiB 9.44 MiB 1.58 MiB
f761369 7.86 MiB 9.44 MiB 1.58 MiB
0fb3800 7.86 MiB 9.44 MiB 1.58 MiB
e04b24b 5.53 MiB 6.00 MiB 480.00 KiB
1f639ee 5.53 MiB 6.00 MiB 479.95 KiB

Previous results on branch: replay/add-sensitive-content

Startup times

Revision Plain With Sentry Diff
088cf62 1266.14 ms 1285.35 ms 19.20 ms
0c59077 1252.77 ms 1271.38 ms 18.61 ms
20657ad 1271.84 ms 1285.37 ms 13.53 ms
e38ab52 1245.25 ms 1243.41 ms -1.84 ms
1f8bf63 1250.02 ms 1271.02 ms 21.00 ms
5ce2839 1271.55 ms 1281.62 ms 10.07 ms
32e3fc4 1270.65 ms 1284.69 ms 14.04 ms

App size

Revision Plain With Sentry Diff
088cf62 7.86 MiB 9.44 MiB 1.58 MiB
0c59077 7.86 MiB 9.44 MiB 1.58 MiB
20657ad 7.86 MiB 9.44 MiB 1.58 MiB
e38ab52 5.53 MiB 6.00 MiB 480.93 KiB
1f8bf63 7.86 MiB 9.54 MiB 1.69 MiB
5ce2839 7.86 MiB 9.44 MiB 1.58 MiB
32e3fc4 7.86 MiB 9.44 MiB 1.58 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 409.10 ms 438.85 ms 29.75 ms
Size 13.93 MiB 15.06 MiB 1.13 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3615e19 468.38 ms 504.71 ms 36.33 ms
fd88186 422.07 ms 469.10 ms 47.03 ms
a69a51f 437.18 ms 450.60 ms 13.42 ms
2d34233 470.54 ms 558.90 ms 88.36 ms
7b21e8b 467.74 ms 466.24 ms -1.50 ms
2cf9161 454.12 ms 512.67 ms 58.55 ms
c26ed0a 465.52 ms 476.38 ms 10.86 ms
93b7728 475.28 ms 489.13 ms 13.86 ms
dbd526b 504.88 ms 569.02 ms 64.15 ms
2b5e090 437.21 ms 467.14 ms 29.93 ms

App size

Revision Plain With Sentry Diff
3615e19 6.54 MiB 7.70 MiB 1.16 MiB
fd88186 13.93 MiB 15.00 MiB 1.06 MiB
a69a51f 13.93 MiB 15.06 MiB 1.13 MiB
2d34233 6.54 MiB 7.55 MiB 1.01 MiB
7b21e8b 13.93 MiB 15.00 MiB 1.06 MiB
2cf9161 6.54 MiB 7.70 MiB 1.16 MiB
c26ed0a 13.93 MiB 14.93 MiB 1.00 MiB
93b7728 6.54 MiB 7.69 MiB 1.15 MiB
dbd526b 6.54 MiB 7.69 MiB 1.15 MiB
2b5e090 13.93 MiB 15.06 MiB 1.13 MiB

Previous results on branch: replay/add-sensitive-content

Startup times

Revision Plain With Sentry Diff
0c59077 479.96 ms 570.00 ms 90.04 ms
088cf62 462.73 ms 544.39 ms 81.65 ms
32e3fc4 468.26 ms 538.44 ms 70.18 ms
e38ab52 444.62 ms 429.09 ms -15.53 ms
5ce2839 462.72 ms 519.61 ms 56.89 ms
1f8bf63 493.32 ms 568.69 ms 75.37 ms
20657ad 514.06 ms 607.15 ms 93.09 ms

App size

Revision Plain With Sentry Diff
0c59077 6.54 MiB 7.70 MiB 1.16 MiB
088cf62 6.54 MiB 7.70 MiB 1.16 MiB
32e3fc4 6.54 MiB 7.70 MiB 1.16 MiB
e38ab52 13.93 MiB 15.00 MiB 1.06 MiB
5ce2839 6.54 MiB 7.69 MiB 1.15 MiB
1f8bf63 6.54 MiB 7.70 MiB 1.17 MiB
20657ad 6.54 MiB 7.70 MiB 1.16 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2025

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/lib/src/screenshot/recorder.dart

@buenaflor buenaflor marked this pull request as ready for review July 29, 2025 14:37
@buenaflor buenaflor requested a review from stefanosiano as a code owner July 29, 2025 14:37
@buenaflor buenaflor requested a review from denrase as a code owner July 29, 2025 14:37
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.


### Features

- Add [SensitiveContent](https://main-api.flutter.dev/flutter/widgets/SensitiveContent-class.html) widget to default masking ([#2989](https://github.com/getsentry/sentry-dart/pull/2989))
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🚫 The changelog entry seems to be part of an already released section ## 9.8.0.
    Consider moving the entry to the ## Unreleased section, please.

final minor = int.tryParse(
version.substring(dot + 1, nextDot == -1 ? version.length : nextDot));

return major != null &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Could do early returns when either major/minor is null. Also, do we do version check anywhere else? Then we could extract the version reading to a common place and only do the version check here, as we do both now.

final dynamic dynWidget = widget;
final sensitivity = dynWidget.sensitivity;
// If the property exists, we assume this is the SensitiveContent widget.
assert(sensitivity is Enum);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Worth to double-check the cursor[bot] comment.

final minor = int.tryParse(
version.substring(dot + 1, nextDot == -1 ? version.length : nextDot));

if (major! > 3 || (major == 3 && minor! >= 33)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

From above, if we create a helepr and test it popertly we can use it here instead of duplicating version parsing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah sorry, I think those are leftovers of when I did the testing, I'll properly expose the function instead

if (version == null) {
return [];
}
final dot = version.indexOf('.');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, duplicated logic for the third time.

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.

Support SensitiveContent

4 participants