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

Add debounce to ScreenshotWidget #2368

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Oct 22, 2024

📜 Description

Debounce screenshots made by sentry to avoid being removed by iOS watchdog.

Bildschirmfoto 2024-10-22 um 11 34 36

💡 Motivation and Context

Relates to #2360
Relates to #2368

💚 How did you test it?

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

Copy link
Contributor

github-actions bot commented Oct 22, 2024

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

Generated by 🚫 dangerJS against b157a35

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.96%. Comparing base (13c8257) to head (b157a35).

Files with missing lines Patch % Lines
flutter/lib/src/utils/timer_debouncer.dart 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2368      +/-   ##
==========================================
+ Coverage   85.04%   85.96%   +0.92%     
==========================================
  Files         257       82     -175     
  Lines        9194     2886    -6308     
==========================================
- Hits         7819     2481    -5338     
+ Misses       1375      405     -970     

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


🚨 Try these New Features:

Copy link
Contributor

github-actions bot commented Oct 22, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1256.12 ms 1273.90 ms 17.78 ms
Size 8.38 MiB 9.77 MiB 1.39 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f0fcbe1 1238.08 ms 1243.44 ms 5.36 ms
0a23f98 1252.98 ms 1276.76 ms 23.78 ms
c978477 1228.43 ms 1249.17 ms 20.74 ms
a40bb7c 1222.75 ms 1240.88 ms 18.13 ms
6034b0a 1244.89 ms 1270.22 ms 25.33 ms
ef2f368 1259.12 ms 1277.04 ms 17.92 ms
ecb4003 1266.94 ms 1290.24 ms 23.31 ms
e0ba81f 1240.27 ms 1260.15 ms 19.88 ms
d5fb969 1228.79 ms 1256.17 ms 27.38 ms
7ec9238 1259.69 ms 1281.59 ms 21.90 ms

App size

Revision Plain With Sentry Diff
f0fcbe1 8.29 MiB 9.38 MiB 1.09 MiB
0a23f98 8.10 MiB 9.18 MiB 1.08 MiB
c978477 8.32 MiB 9.50 MiB 1.18 MiB
a40bb7c 8.38 MiB 9.73 MiB 1.35 MiB
6034b0a 8.33 MiB 9.40 MiB 1.07 MiB
ef2f368 8.15 MiB 9.10 MiB 965.24 KiB
ecb4003 8.09 MiB 9.07 MiB 1000.82 KiB
e0ba81f 8.38 MiB 9.71 MiB 1.34 MiB
d5fb969 8.33 MiB 9.64 MiB 1.31 MiB
7ec9238 8.34 MiB 9.65 MiB 1.31 MiB

Previous results on branch: feat/screenshot-debounce

Startup times

Revision Plain With Sentry Diff
e5f628a 1227.47 ms 1229.73 ms 2.26 ms
5a9bcac 1258.37 ms 1282.79 ms 24.42 ms
e96bb8d 1248.14 ms 1270.88 ms 22.73 ms
9fce5c0 1226.77 ms 1248.82 ms 22.05 ms
3d489d9 1256.27 ms 1279.69 ms 23.42 ms

App size

Revision Plain With Sentry Diff
e5f628a 8.38 MiB 9.75 MiB 1.37 MiB
5a9bcac 8.38 MiB 9.77 MiB 1.39 MiB
e96bb8d 8.38 MiB 9.77 MiB 1.39 MiB
9fce5c0 8.38 MiB 9.77 MiB 1.39 MiB
3d489d9 8.38 MiB 9.75 MiB 1.37 MiB

Copy link
Contributor

github-actions bot commented Oct 22, 2024

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 668.50 ms 743.42 ms 74.92 ms
Size 6.49 MiB 7.56 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2966d88 365.71 ms 422.50 ms 56.79 ms
affcf07 446.19 ms 476.32 ms 30.13 ms
fcd1ee4 298.96 ms 376.04 ms 77.09 ms
b47809a 333.42 ms 368.36 ms 34.95 ms
c1bb00f 303.77 ms 371.88 ms 68.11 ms
f770c4c 385.88 ms 449.86 ms 63.98 ms
3d305b9 403.55 ms 469.76 ms 66.20 ms
ea60f10 456.23 ms 494.48 ms 38.25 ms
8609bd8 359.76 ms 437.40 ms 77.64 ms
7748b7c 356.37 ms 426.70 ms 70.33 ms

App size

Revision Plain With Sentry Diff
2966d88 6.33 MiB 7.27 MiB 954.11 KiB
affcf07 6.52 MiB 7.59 MiB 1.06 MiB
fcd1ee4 6.16 MiB 7.13 MiB 1000.85 KiB
b47809a 5.94 MiB 6.96 MiB 1.02 MiB
c1bb00f 6.06 MiB 7.09 MiB 1.03 MiB
f770c4c 6.33 MiB 7.26 MiB 950.37 KiB
3d305b9 6.35 MiB 7.35 MiB 1021.16 KiB
ea60f10 6.49 MiB 7.55 MiB 1.07 MiB
8609bd8 6.27 MiB 7.20 MiB 959.07 KiB
7748b7c 6.27 MiB 7.20 MiB 959.09 KiB

Previous results on branch: feat/screenshot-debounce

Startup times

Revision Plain With Sentry Diff
3d489d9 452.25 ms 498.58 ms 46.33 ms
e5f628a 451.42 ms 495.36 ms 43.94 ms
5a9bcac 441.24 ms 476.58 ms 35.34 ms
9fce5c0 458.88 ms 484.86 ms 25.98 ms
e96bb8d 451.02 ms 488.94 ms 37.92 ms

App size

Revision Plain With Sentry Diff
3d489d9 6.49 MiB 7.57 MiB 1.08 MiB
e5f628a 6.49 MiB 7.57 MiB 1.08 MiB
5a9bcac 6.49 MiB 7.56 MiB 1.07 MiB
9fce5c0 6.49 MiB 7.56 MiB 1.07 MiB
e96bb8d 6.49 MiB 7.56 MiB 1.07 MiB

@denrase denrase marked this pull request as ready for review October 22, 2024 11:49
@denrase
Copy link
Collaborator Author

denrase commented Oct 23, 2024

Closing due to discussion here: #2371 (comment)

@denrase denrase closed this Oct 23, 2024
@denrase denrase reopened this Nov 12, 2024
@denrase denrase self-assigned this Nov 12, 2024
@denrase denrase marked this pull request as draft November 12, 2024 08:58
@denrase denrase removed their assignment Nov 12, 2024
@denrase denrase marked this pull request as ready for review November 12, 2024 10:21
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.

lgtm 👍

I'll approve once the tests etc are green

flutter/test/utils/debouncer_test.dart Outdated Show resolved Hide resolved
@buenaflor
Copy link
Contributor

buenaflor commented Nov 12, 2024

as mentioned, let's deprecate beforeSendScreenshot and advise users to use beforeScreenshotCapture instead

@denrase
Copy link
Collaborator Author

denrase commented Nov 13, 2024

@buenaflor Looks like we have some provisioning profile issue.

@buenaflor
Copy link
Contributor

buenaflor commented Nov 14, 2024

@denrase on it

edit: ci is fixed

@buenaflor
Copy link
Contributor

before capture callback looks like is added to the redact screenshot pr: https://github.com/getsentry/sentry-dart/pull/2361/files, _options.screenshot.beforeCapture although I'm not sure whether we should keep our approach with beforeCaptureScreenshot, might be easier to manage?

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