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 create transaction for unused ViewControllers #4448

Merged
merged 7 commits into from
Oct 18, 2024

Conversation

brustolin
Copy link
Contributor

📜 Description

Its possible to create a view controller but never add it to the view hierarchy.
This will create a transaction with data that is not helpful

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

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.359%. Comparing base (149877e) to head (3260d34).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4448       +/-   ##
=============================================
+ Coverage   91.318%   91.359%   +0.040%     
=============================================
  Files          609       610        +1     
  Lines        49855     49960      +105     
  Branches     17932     18055      +123     
=============================================
+ Hits         45527     45643      +116     
+ Misses        4236      4227        -9     
+ Partials        92        90        -2     
Files with missing lines Coverage Δ
Sources/Sentry/SentryPerformanceTracker.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryTracer.m 97.887% <100.000%> (+0.975%) ⬆️
Sources/Sentry/SentryTracerConfiguration.m 100.000% <100.000%> (ø)
...entryUIViewControllerPerformanceTrackerTests.swift 98.409% <100.000%> (+0.005%) ⬆️
...ts/SentryTests/Transaction/SentryTracerTests.swift 98.394% <100.000%> (+0.011%) ⬆️

... and 19 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 149877e...3260d34. Read the comment docs.

Copy link

github-actions bot commented Oct 16, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1233.15 ms 1247.57 ms 14.43 ms
Size 21.90 KiB 708.13 KiB 686.23 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
add8416 1270.72 ms 1300.38 ms 29.66 ms
2b55154 1231.36 ms 1247.82 ms 16.46 ms
ceb2092 1208.19 ms 1236.46 ms 28.27 ms
24e0744 1229.04 ms 1250.10 ms 21.06 ms
7bc3c0d 1259.74 ms 1268.45 ms 8.71 ms
46467d0 1229.00 ms 1241.27 ms 12.27 ms
2401cbd 1219.49 ms 1250.14 ms 30.65 ms
60bfc91 1220.39 ms 1250.89 ms 30.50 ms
2a8b38b 1217.57 ms 1235.16 ms 17.59 ms
42ef6ba 1211.20 ms 1228.17 ms 16.96 ms

App size

Revision Plain With Sentry Diff
add8416 21.58 KiB 541.91 KiB 520.33 KiB
2b55154 22.84 KiB 402.19 KiB 379.34 KiB
ceb2092 21.58 KiB 670.39 KiB 648.81 KiB
24e0744 21.58 KiB 709.06 KiB 687.48 KiB
7bc3c0d 20.76 KiB 427.35 KiB 406.59 KiB
46467d0 21.58 KiB 698.11 KiB 676.53 KiB
2401cbd 22.85 KiB 408.85 KiB 386.00 KiB
60bfc91 20.76 KiB 434.94 KiB 414.18 KiB
2a8b38b 21.58 KiB 424.30 KiB 402.71 KiB
42ef6ba 21.58 KiB 417.86 KiB 396.28 KiB

Previous results on branch: fix/unused-viewcontroller

Startup times

Revision Plain With Sentry Diff
d10f156 1213.15 ms 1231.90 ms 18.75 ms
702c63e 1228.55 ms 1245.65 ms 17.09 ms

App size

Revision Plain With Sentry Diff
d10f156 21.90 KiB 707.62 KiB 685.71 KiB
702c63e 21.90 KiB 707.47 KiB 685.57 KiB

@brustolin brustolin linked an issue Oct 17, 2024 that may be closed by this pull request
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.

Almost, LGTM. Thanks

CHANGELOG.md Outdated Show resolved Hide resolved
Sources/Sentry/SentryTracer.m Outdated Show resolved Hide resolved
Sources/Sentry/SentryTracer.m Show resolved Hide resolved
Sources/Sentry/SentryTracer.m Outdated Show resolved Hide resolved
Sources/Sentry/include/SentryTracer.h Outdated Show resolved Hide resolved
@brustolin brustolin merged commit 354f6e7 into main Oct 18, 2024
23 of 25 checks passed
@brustolin brustolin deleted the fix/unused-viewcontroller branch October 18, 2024 09:21
Copy link

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Dont create transaction for unused ViewControllers ([#4448](https://github.com/getsentry/sentry-cocoa/pull/4448))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against d74b5ae

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.

Cancel non used view controllers transactions
2 participants