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(sdk): Collect only unique UIWindow references #4159

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Jul 12, 2024

📜 Description

When scene and app delegate holds reference to the same windows, it's added twice to the array.

💡 Motivation and Context

Duplicate reference causes issues like taking two screenshots of the same window.

💚 How did you test it?

unit tests and rn sample app

Screenshot 2024-07-12 at 22 22 40 Screenshot 2024-07-12 at 22 22 10

📝 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.

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.399%. Comparing base (bce565d) to head (579b9d4).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4159       +/-   ##
=============================================
+ Coverage   91.381%   91.399%   +0.017%     
=============================================
  Files          605       606        +1     
  Lines        48570     48681      +111     
  Branches     17497     17565       +68     
=============================================
+ Hits         44384     44494      +110     
  Misses        4093      4093               
- Partials        93        94        +1     
Files Coverage Δ
Sources/Sentry/SentryUIApplication.m 47.540% <100.000%> (ø)
Tests/SentryTests/SentryUIApplicationTests.swift 100.000% <100.000%> (ø)

... and 16 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 bce565d...579b9d4. Read the comment docs.

Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1231.45 ms 1253.38 ms 21.93 ms
Size 21.58 KiB 683.49 KiB 661.91 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
699d76f 1238.08 ms 1257.67 ms 19.59 ms
46267d8 1229.80 ms 1244.16 ms 14.37 ms
c0b4b71 1218.16 ms 1251.28 ms 33.12 ms
455619d 1231.40 ms 1237.70 ms 6.30 ms
103d817 1211.55 ms 1213.35 ms 1.80 ms
7bbb7c3 1232.40 ms 1249.78 ms 17.38 ms
1ac58a6 1232.07 ms 1254.69 ms 22.63 ms
e998fd0 1241.49 ms 1262.63 ms 21.14 ms
42ef6ba 1201.67 ms 1214.35 ms 12.67 ms
ef5821b 1253.18 ms 1265.46 ms 12.28 ms

App size

Revision Plain With Sentry Diff
699d76f 21.58 KiB 631.82 KiB 610.24 KiB
46267d8 21.58 KiB 572.21 KiB 550.63 KiB
c0b4b71 20.76 KiB 430.98 KiB 410.22 KiB
455619d 20.76 KiB 432.87 KiB 412.11 KiB
103d817 21.58 KiB 571.91 KiB 550.33 KiB
7bbb7c3 21.58 KiB 418.78 KiB 397.20 KiB
1ac58a6 21.58 KiB 626.07 KiB 604.49 KiB
e998fd0 21.58 KiB 414.59 KiB 393.01 KiB
42ef6ba 21.58 KiB 417.86 KiB 396.28 KiB
ef5821b 21.58 KiB 414.96 KiB 393.37 KiB

@brustolin brustolin enabled auto-merge (squash) July 24, 2024 11:12
@brustolin brustolin merged commit e8c8a05 into main Jul 24, 2024
67 checks passed
@brustolin brustolin deleted the kw/fix-duplicate-windows branch July 24, 2024 11:12
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