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

fix: Dont take screenshot and view hierarchy for app hanging #3620

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

brustolin
Copy link
Contributor

📜 Description

We stop taking screenshot and view hierarchy during app hang events.

💡 Motivation and Context

Main thread is blocked, and its not safe to use ui elements.

💚 How did you test it?

Unit tests

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @brustolin.

@philipphofmann
Copy link
Member

Related PR #3547 and issue #3220.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (7bbb7c3) 89.360% compared to head (362a862) 89.339%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3620       +/-   ##
=============================================
- Coverage   89.360%   89.339%   -0.022%     
=============================================
  Files          530       530               
  Lines        58243     58231       -12     
  Branches     20891     20883        -8     
=============================================
- Hits         52046     52023       -23     
- Misses        5173      5183       +10     
- Partials      1024      1025        +1     
Files Coverage Δ
Sources/Sentry/SentryScreenshotIntegration.m 91.489% <100.000%> (-0.348%) ⬇️
Sources/Sentry/SentryViewHierarchyIntegration.m 100.000% <100.000%> (ø)
...Integrations/Screenshot/TestSentryScreenShot.swift 50.000% <0.000%> (-50.000%) ⬇️
...ierarchy/SentryViewHierarchyIntegrationTests.swift 97.478% <50.000%> (-1.681%) ⬇️
.../Screenshot/SentryScreenshotIntegrationTests.swift 98.148% <33.333%> (-1.235%) ⬇️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bbb7c3...362a862. Read the comment docs.

Copy link

github-actions bot commented Feb 7, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1216.94 ms 1244.43 ms 27.49 ms
Size 21.58 KiB 418.76 KiB 397.18 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
43aa39d 1239.16 ms 1270.42 ms 31.26 ms
af1f4dd 1232.39 ms 1255.88 ms 23.49 ms
e778bd2 1224.66 ms 1252.16 ms 27.50 ms
407ff99 1225.49 ms 1232.88 ms 7.39 ms
3297d6e 1206.80 ms 1213.86 ms 7.06 ms
75ef4eb 1237.30 ms 1249.53 ms 12.23 ms
89bc37d 1240.76 ms 1248.24 ms 7.48 ms
d257eb9 1226.08 ms 1256.54 ms 30.46 ms
23ce4a9 1275.73 ms 1278.78 ms 3.05 ms
7cd187e 1204.78 ms 1235.86 ms 31.08 ms

App size

Revision Plain With Sentry Diff
43aa39d 20.76 KiB 432.82 KiB 412.06 KiB
af1f4dd 22.85 KiB 414.71 KiB 391.86 KiB
e778bd2 20.76 KiB 426.15 KiB 405.39 KiB
407ff99 20.76 KiB 427.87 KiB 407.10 KiB
3297d6e 21.58 KiB 418.44 KiB 396.86 KiB
75ef4eb 22.85 KiB 413.45 KiB 390.60 KiB
89bc37d 20.76 KiB 401.53 KiB 380.77 KiB
d257eb9 20.76 KiB 433.23 KiB 412.47 KiB
23ce4a9 22.85 KiB 413.45 KiB 390.60 KiB
7cd187e 20.76 KiB 401.65 KiB 380.89 KiB

@brustolin brustolin merged commit 65290e0 into main Feb 7, 2024
71 of 74 checks passed
@brustolin brustolin deleted the fix/apphang-ss-vh branch February 7, 2024 14:07
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