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

Swizzling of view controllers loadView that dont implement loadView` #4071

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

brustolin
Copy link
Contributor

📜 Description

Stop swizzling loadView function of UIViewControllers that doesn't implement it.

💡 Motivation and Context

close #4070

💚 How did you test it?

In the sample.
Current ui tests already tackles this.

📝 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

github-actions bot commented Jun 14, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryUIViewControllerSwizzling.m

Copy link

github-actions bot commented Jun 14, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryUIViewControllerSwizzling.m

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.217%. Comparing base (e145ca1) to head (b7383cb).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4071       +/-   ##
=============================================
+ Coverage   91.187%   91.217%   +0.029%     
=============================================
  Files          611       610        -1     
  Lines        48126     48039       -87     
  Branches     17283     17225       -58     
=============================================
- Hits         43885     43820       -65     
+ Misses        4148      4127       -21     
+ Partials        93        92        -1     
Files Coverage Δ
Sources/Sentry/SentryUIViewControllerSwizzling.m 87.619% <100.000%> (ø)

... and 25 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 e145ca1...b7383cb. Read the comment docs.

Copy link

github-actions bot commented Jun 14, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryUIViewControllerSwizzling.m

Copy link

github-actions bot commented Jun 14, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryUIViewControllerSwizzling.m

Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1203.59 ms 1221.85 ms 18.26 ms
Size 21.58 KiB 669.73 KiB 648.15 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4b08ceb 1237.75 ms 1249.61 ms 11.86 ms
2c603bf 1226.66 ms 1243.06 ms 16.40 ms
4b1a58e 1237.39 ms 1265.63 ms 28.23 ms
881a955 1231.92 ms 1247.90 ms 15.98 ms
596ccc1 1221.57 ms 1236.82 ms 15.25 ms
189b629 1211.16 ms 1224.30 ms 13.14 ms
e8b11f8 1233.66 ms 1249.74 ms 16.08 ms
7b5ebd9 1195.55 ms 1214.49 ms 18.94 ms
01a28a9 1237.33 ms 1256.52 ms 19.20 ms
6e625c5 1243.47 ms 1243.58 ms 0.11 ms

App size

Revision Plain With Sentry Diff
4b08ceb 20.76 KiB 431.99 KiB 411.23 KiB
2c603bf 21.58 KiB 417.88 KiB 396.30 KiB
4b1a58e 22.85 KiB 407.02 KiB 384.17 KiB
881a955 22.85 KiB 407.63 KiB 384.78 KiB
596ccc1 22.84 KiB 401.44 KiB 378.60 KiB
189b629 20.76 KiB 399.69 KiB 378.93 KiB
e8b11f8 22.85 KiB 411.92 KiB 389.07 KiB
7b5ebd9 21.58 KiB 424.30 KiB 402.71 KiB
01a28a9 22.85 KiB 405.39 KiB 382.55 KiB
6e625c5 22.85 KiB 413.41 KiB 390.56 KiB

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.

Thanks for the comment 👍

@brustolin brustolin merged commit e19cca3 into main Jun 14, 2024
66 checks passed
@brustolin brustolin deleted the fix/swizzling-loadView branch June 14, 2024 08:59
brustolin added a commit that referenced this pull request Jun 18, 2024
TableViewController is now initialized from a Nib file with an extra view.
This is an additional test for the changes introduced in #4071.
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.

Crash when initializing a UITableViewController from IB
3 participants