-
-
Notifications
You must be signed in to change notification settings - Fork 372
chore: Convert SentryAutoSessionTrackingIntegration to Swift
#6961
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6961 +/- ##
=============================================
+ Coverage 85.043% 85.120% +0.076%
=============================================
Files 453 453
Lines 27681 27683 +2
Branches 12166 12165 -1
=============================================
+ Hits 23541 23564 +23
+ Misses 4094 4076 -18
+ Partials 46 43 -3
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 83e9b16 | 1223.25 ms | 1250.94 ms | 27.69 ms |
| 8745cc0 | 1228.13 ms | 1250.48 ms | 22.35 ms |
| abafa5d | 1228.91 ms | 1257.11 ms | 28.20 ms |
| 39e3732 | 1193.96 ms | 1219.51 ms | 25.55 ms |
| ea5a59b | 1222.87 ms | 1253.47 ms | 30.60 ms |
| e5773c1 | 1235.10 ms | 1264.15 ms | 29.04 ms |
| 2609f7a | 1218.17 ms | 1241.34 ms | 23.17 ms |
| 827b50c | 1233.27 ms | 1267.28 ms | 34.01 ms |
| daf8077 | 1202.78 ms | 1235.52 ms | 32.74 ms |
| 1ed7bf6 | 1215.78 ms | 1255.78 ms | 40.00 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 83e9b16 | 23.75 KiB | 947.72 KiB | 923.97 KiB |
| 8745cc0 | 23.74 KiB | 971.81 KiB | 948.07 KiB |
| abafa5d | 23.74 KiB | 1023.00 KiB | 999.25 KiB |
| 39e3732 | 24.15 KiB | 1.01 MiB | 1014.59 KiB |
| ea5a59b | 23.75 KiB | 874.46 KiB | 850.71 KiB |
| e5773c1 | 23.75 KiB | 1.00 MiB | 1005.08 KiB |
| 2609f7a | 23.75 KiB | 867.04 KiB | 843.29 KiB |
| 827b50c | 23.75 KiB | 1.00 MiB | 1005.07 KiB |
| daf8077 | 23.75 KiB | 971.82 KiB | 948.07 KiB |
| 1ed7bf6 | 24.14 KiB | 1.01 MiB | 1012.91 KiB |
|
|
||
| autoSessionTrackingIntegration = SentryAutoSessionTrackingIntegration() | ||
| autoSessionTrackingIntegration.install(with: options) | ||
| autoSessionTrackingIntegration = SentryAutoSessionTrackingIntegration(with: options, dependencies: SentryDependencyContainer.sharedInstance()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Test crashes due to nil integration with disabled tracking
The test sets options.enableAutoSessionTracking = false to prevent automatic SDK installation, then manually creates SentryAutoSessionTrackingIntegration. However, the new Swift implementation's failable initializer returns nil when enableAutoSessionTracking is false. Since autoSessionTrackingIntegration is declared as an implicitly unwrapped optional (!), subsequent calls to .stop() in tearDown() and throughout the test will crash due to force-unwrapping nil.
Converts
SentryAutoSessionTrackingIntegrationto Swift in preparation for some fixes for System Extensions (see this issue)