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 24 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 e96bb8d

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 86.02%. Comparing base (dd16d3e) to head (e96bb8d).

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.06%   86.02%   +0.96%     
==========================================
  Files         257       82     -175     
  Lines        9191     2883    -6308     
==========================================
- Hits         7818     2480    -5338     
+ Misses       1373      403     -970     

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

Copy link
Contributor

github-actions bot commented Oct 22, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1248.14 ms 1270.88 ms 22.73 ms
Size 8.38 MiB 9.77 MiB 1.39 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3a43905 1254.31 ms 1266.35 ms 12.04 ms
895becc 1288.00 ms 1308.63 ms 20.63 ms
ed2ae08 1222.10 ms 1226.57 ms 4.47 ms
3a16179 1238.18 ms 1255.62 ms 17.44 ms
6572f8d 1242.16 ms 1246.63 ms 4.47 ms
62dde43 1258.43 ms 1276.81 ms 18.38 ms
5112c69 1272.76 ms 1293.37 ms 20.61 ms
b44db8f 1255.29 ms 1258.90 ms 3.61 ms
8cb6557 1265.14 ms 1266.08 ms 0.94 ms
136c365 1248.12 ms 1277.33 ms 29.20 ms

App size

Revision Plain With Sentry Diff
3a43905 8.10 MiB 9.18 MiB 1.08 MiB
895becc 8.10 MiB 9.18 MiB 1.08 MiB
ed2ae08 8.28 MiB 9.34 MiB 1.06 MiB
3a16179 8.38 MiB 9.73 MiB 1.35 MiB
6572f8d 8.29 MiB 9.36 MiB 1.07 MiB
62dde43 8.16 MiB 9.17 MiB 1.01 MiB
5112c69 8.16 MiB 9.17 MiB 1.01 MiB
b44db8f 8.29 MiB 9.37 MiB 1.08 MiB
8cb6557 8.10 MiB 9.18 MiB 1.08 MiB
136c365 8.38 MiB 9.75 MiB 1.37 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
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
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 451.02 ms 488.94 ms 37.92 ms
Size 6.49 MiB 7.56 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e5b744f 302.70 ms 342.17 ms 39.47 ms
0ac1eed 370.60 ms 441.54 ms 70.94 ms
90a08ea 477.25 ms 534.10 ms 56.85 ms
0db91cc 327.85 ms 387.31 ms 59.46 ms
061fed2 434.11 ms 506.49 ms 72.38 ms
4829ad3 381.55 ms 455.45 ms 73.90 ms
519423f 357.00 ms 415.77 ms 58.77 ms
ddc97ad 331.45 ms 384.06 ms 52.61 ms
e3ef570 389.71 ms 459.16 ms 69.45 ms
2d3b03d 309.53 ms 353.40 ms 43.87 ms

App size

Revision Plain With Sentry Diff
e5b744f 6.06 MiB 7.09 MiB 1.03 MiB
0ac1eed 6.06 MiB 7.03 MiB 990.44 KiB
90a08ea 6.49 MiB 7.55 MiB 1.06 MiB
0db91cc 5.94 MiB 6.95 MiB 1.01 MiB
061fed2 6.52 MiB 7.59 MiB 1.06 MiB
4829ad3 6.33 MiB 7.26 MiB 943.11 KiB
519423f 6.06 MiB 7.03 MiB 989.24 KiB
ddc97ad 6.16 MiB 7.14 MiB 1003.75 KiB
e3ef570 6.33 MiB 7.26 MiB 950.38 KiB
2d3b03d 6.06 MiB 7.09 MiB 1.03 MiB

Previous results on branch: feat/screenshot-debounce

Startup times

Revision Plain With Sentry Diff
e5f628a 451.42 ms 495.36 ms 43.94 ms
3d489d9 452.25 ms 498.58 ms 46.33 ms

App size

Revision Plain With Sentry Diff
e5f628a 6.49 MiB 7.57 MiB 1.08 MiB
3d489d9 6.49 MiB 7.57 MiB 1.08 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

@denrase on it

/// Sets a callback which is executed before capturing screenshots. Only
/// relevant if `attachScreenshot` is set to true. When false is returned
/// from the function, no screenshot will be attached.
BeforeScreenshotCallback? beforeScreenshot;
BeforeCaptureCallback? beforeCapture;
Copy link
Contributor

Choose a reason for hiding this comment

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

should it not be beforeScreenshotCapture? to make it a bit more specific

see: here and here

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