-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
redact screenshots via view hierarchy #2361
redact screenshots via view hierarchy #2361
Conversation
…nd ScreenshotRecorderConfig.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2361 +/- ##
==========================================
+ Coverage 86.94% 92.09% +5.14%
==========================================
Files 257 83 -174
Lines 9238 2871 -6367
==========================================
- Hits 8032 2644 -5388
+ Misses 1206 227 -979 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Android Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d4120ac | 373.14 ms | 447.35 ms | 74.21 ms |
103eb14 | 405.50 ms | 444.30 ms | 38.80 ms |
ad69abc | 297.35 ms | 385.89 ms | 88.54 ms |
72dfc83 | 298.62 ms | 340.14 ms | 41.52 ms |
061fed2 | 434.11 ms | 506.49 ms | 72.38 ms |
256df44 | 447.58 ms | 485.84 ms | 38.25 ms |
30c1193 | 349.00 ms | 438.20 ms | 89.20 ms |
408bdab | 360.18 ms | 434.92 ms | 74.74 ms |
cecd4ed | 438.09 ms | 490.12 ms | 52.04 ms |
09eab47 | 455.30 ms | 478.46 ms | 23.16 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d4120ac | 6.27 MiB | 7.20 MiB | 960.42 KiB |
103eb14 | 6.52 MiB | 7.59 MiB | 1.06 MiB |
ad69abc | 6.06 MiB | 7.09 MiB | 1.03 MiB |
72dfc83 | 5.94 MiB | 6.92 MiB | 1001.71 KiB |
061fed2 | 6.52 MiB | 7.59 MiB | 1.06 MiB |
256df44 | 6.52 MiB | 7.59 MiB | 1.06 MiB |
30c1193 | 6.27 MiB | 7.20 MiB | 958.74 KiB |
408bdab | 6.27 MiB | 7.20 MiB | 959.07 KiB |
cecd4ed | 6.49 MiB | 7.57 MiB | 1.08 MiB |
09eab47 | 6.49 MiB | 7.56 MiB | 1.07 MiB |
Previous results on branch: feat/redact-screenshots-via-view-hierarchy
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
198d1a3 | 478.64 ms | 529.65 ms | 51.01 ms |
cc1d836 | 506.06 ms | 517.21 ms | 11.15 ms |
42be7f3 | 351.20 ms | 372.54 ms | 21.34 ms |
606454f | 473.23 ms | 532.88 ms | 59.65 ms |
22f22b0 | 468.33 ms | 511.96 ms | 43.63 ms |
57a0823 | 485.63 ms | 526.69 ms | 41.06 ms |
823598a | 468.91 ms | 496.46 ms | 27.55 ms |
8202004 | 464.45 ms | 512.12 ms | 47.67 ms |
3606202 | 672.45 ms | 690.24 ms | 17.80 ms |
73a4224 | 510.66 ms | 563.88 ms | 53.22 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
198d1a3 | 6.49 MiB | 7.56 MiB | 1.07 MiB |
cc1d836 | 6.49 MiB | 7.56 MiB | 1.07 MiB |
42be7f3 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
606454f | 6.49 MiB | 7.56 MiB | 1.07 MiB |
22f22b0 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
57a0823 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
823598a | 6.49 MiB | 7.56 MiB | 1.07 MiB |
8202004 | 6.49 MiB | 7.56 MiB | 1.07 MiB |
3606202 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
73a4224 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
iOS Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
a49594a | 1284.83 ms | 1313.29 ms | 28.45 ms |
f2db4ec | 1244.14 ms | 1259.79 ms | 15.65 ms |
117d988 | 1200.83 ms | 1223.24 ms | 22.41 ms |
613760b | 1263.10 ms | 1277.27 ms | 14.16 ms |
48adddf | 1255.76 ms | 1280.31 ms | 24.55 ms |
09c1f55 | 1258.11 ms | 1280.45 ms | 22.34 ms |
3a69405 | 1292.84 ms | 1303.96 ms | 11.12 ms |
0a23f98 | 1252.98 ms | 1276.76 ms | 23.78 ms |
3e33891 | 6245.86 ms | 6260.90 ms | 15.04 ms |
e8603bb | 1240.85 ms | 1254.79 ms | 13.94 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
a49594a | 8.16 MiB | 9.16 MiB | 1.00 MiB |
f2db4ec | 8.10 MiB | 9.16 MiB | 1.07 MiB |
117d988 | 8.32 MiB | 9.38 MiB | 1.05 MiB |
613760b | 8.15 MiB | 9.13 MiB | 1000.46 KiB |
48adddf | 8.28 MiB | 9.34 MiB | 1.06 MiB |
09c1f55 | 8.38 MiB | 9.74 MiB | 1.36 MiB |
3a69405 | 8.15 MiB | 9.15 MiB | 1018.56 KiB |
0a23f98 | 8.10 MiB | 9.18 MiB | 1.08 MiB |
3e33891 | 8.29 MiB | 9.38 MiB | 1.09 MiB |
e8603bb | 8.33 MiB | 9.40 MiB | 1.07 MiB |
Previous results on branch: feat/redact-screenshots-via-view-hierarchy
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
981039c | 1231.98 ms | 1243.80 ms | 11.82 ms |
22f22b0 | 1248.92 ms | 1274.13 ms | 25.21 ms |
35ebb0b | 1230.51 ms | 1247.45 ms | 16.94 ms |
8202004 | 1244.20 ms | 1249.82 ms | 5.61 ms |
d6212ac | 1248.63 ms | 1267.72 ms | 19.08 ms |
3606202 | 1257.33 ms | 1284.26 ms | 26.93 ms |
823598a | 1251.18 ms | 1275.98 ms | 24.80 ms |
198d1a3 | 1244.67 ms | 1259.96 ms | 15.28 ms |
57a0823 | 1239.41 ms | 1267.28 ms | 27.87 ms |
73a4224 | 1240.18 ms | 1266.15 ms | 25.96 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
981039c | 8.38 MiB | 9.75 MiB | 1.37 MiB |
22f22b0 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
35ebb0b | 8.38 MiB | 9.75 MiB | 1.37 MiB |
8202004 | 8.38 MiB | 9.77 MiB | 1.39 MiB |
d6212ac | 8.38 MiB | 9.77 MiB | 1.39 MiB |
3606202 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
823598a | 8.38 MiB | 9.77 MiB | 1.39 MiB |
198d1a3 | 8.38 MiB | 9.77 MiB | 1.39 MiB |
57a0823 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
73a4224 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
@vaind @buenaflor I moved the redacting features from the SR(Screen Replay) config to the SS(ScreenShot) config and derived from it. I also copied the options from SR for the SS functionality.
|
There still may be changes to replay as well as the redaction logic, therefore I'd say it should be marked experimental for screenshot redaction too. The main purpose is that it lets users know they should use this feature with care as it may have some issues. Also it may change without a major release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this is still a draft but wanted to have a first look early. Looks like you're on a good path to integrating these two features, I've just had some comments what could possibly be improved.
flutter/lib/src/event_processor/screenshot_event_processor.dart
Outdated
Show resolved
Hide resolved
@buenaflor @vaind In IMHO I would assume, that the final beforeScreenshot = _options.screenshot.beforeCapture;
if (beforeScreenshot != null) {
try {
final result = beforeScreenshot(event, hint: hint);
bool takeScreenshot;
if (result is Future<bool>) {
takeScreenshot = await result;
} else {
takeScreenshot = result;
}
if (!takeScreenshot) {
return event;
}
} catch (exception, stackTrace) {
_options.logger(
SentryLevel.error,
'The beforeScreenshot callback threw an exception',
exception: exception,
stackTrace: stackTrace,
);
if (_options.automatedTestMode) {
rethrow;
}
}
}
final renderer = _options.rendererWrapper.getRenderer();
if (_options.platformChecker.isWeb &&
renderer != FlutterRenderer.canvasKit) {
_options.logger(
SentryLevel.debug,
'Cannot take screenshot with ${renderer?.name} renderer.',
);
return event;
} |
🚨 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:
|
@vaind I reverted the changes regarding the Let me know, if I can support you in testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for all the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one last comment
I will now start to update the docs, based on the changes of this PR. |
We should merge prior to docs changes as these should normally come live only when a release is being made |
📜 Description
Switching to View Hierarchy for screenshot generation.
💡 Motivation and Context
close #1956
💚 How did you test it?
Example App and Unittests
📝 Checklist
sendDefaultPii
is enabled🔮 Next steps