-
-
Notifications
You must be signed in to change notification settings - Fork 329
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: Fix FileIO tracking for macOS 15 and iOS 18 #4605
base: main
Are you sure you want to change the base?
Conversation
🚨 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:
|
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Fix FileIO tracking for macOS 15 and iOS 18 ([#4605](https://github.com/getsentry/sentry-cocoa/pull/4605)) If none of the above apply, you can opt out of this check by adding |
We could consider to refactor the class |
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
3a6495e | 1227.61 ms | 1239.22 ms | 11.60 ms |
869ab7e | 1230.36 ms | 1255.49 ms | 25.13 ms |
5f6f658 | 1221.08 ms | 1241.84 ms | 20.76 ms |
be4734f | 1216.47 ms | 1237.47 ms | 21.00 ms |
742d4b6 | 1230.41 ms | 1247.23 ms | 16.83 ms |
89491ad | 1222.12 ms | 1231.96 ms | 9.83 ms |
ef284b2 | 1211.76 ms | 1229.69 ms | 17.93 ms |
d77a671 | 1236.63 ms | 1250.66 ms | 14.03 ms |
a2af9fa | 1236.29 ms | 1251.67 ms | 15.38 ms |
533859f | 1211.33 ms | 1228.76 ms | 17.43 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
3a6495e | 21.58 KiB | 422.66 KiB | 401.08 KiB |
869ab7e | 20.76 KiB | 432.88 KiB | 412.11 KiB |
5f6f658 | 21.58 KiB | 699.25 KiB | 677.67 KiB |
be4734f | 22.30 KiB | 749.84 KiB | 727.54 KiB |
742d4b6 | 21.58 KiB | 546.20 KiB | 524.62 KiB |
89491ad | 21.58 KiB | 417.89 KiB | 396.30 KiB |
ef284b2 | 20.76 KiB | 401.36 KiB | 380.60 KiB |
d77a671 | 21.58 KiB | 540.04 KiB | 518.46 KiB |
a2af9fa | 20.76 KiB | 432.88 KiB | 412.11 KiB |
533859f | 22.85 KiB | 408.84 KiB | 385.99 KiB |
Previous results on branch: philprime/file-io-tracking-fix
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
80a6dda | 1239.90 ms | 1252.33 ms | 12.43 ms |
1f201e0 | 1231.24 ms | 1254.83 ms | 23.59 ms |
8b628ff | 1213.15 ms | 1239.17 ms | 26.01 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
80a6dda | 22.30 KiB | 751.72 KiB | 729.42 KiB |
1f201e0 | 22.30 KiB | 751.69 KiB | 729.39 KiB |
8b628ff | 22.30 KiB | 751.72 KiB | 729.42 KiB |
🚨 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:
|
Thanks for this investigation. Since you enable testing for iOS 18.2, we have other I/O tests failing. We could solve them in a different PR that will merge to this one, or disable those tests before merging this to Main. |
🚨 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:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4605 +/- ##
=============================================
- Coverage 91.018% 90.562% -0.457%
=============================================
Files 617 619 +2
Lines 70935 71375 +440
Branches 25337 25438 +101
=============================================
+ Hits 64564 64639 +75
- Misses 6279 6644 +365
Partials 92 92
... and 17 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
🚨 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:
|
🚨 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:
|
public func write(to url: URL, options: Data.WritingOptions = []) throws { | ||
// TODO: begin file.write via static tracker | ||
try self.data.write(to: url, options: options) | ||
// TODO: end file.write via static tracker | ||
} |
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.
@philipphofmann @brustolin @armcknight
This is my draft for a wrapper for Swift.Data
, as it does not bridge to NSData anymore.
I created a Swift struct that can mostly be used as a direct drop-in replacement for Swift.Data
(it's a @frozen struct
so I don't think we can "subclass"/swizzle/monkey-patch).
I also considered creating this wrapper as an Objective-C file, if I am not mistaken this would require to use NSData
, because AFAIK we can not use the Swift.Data
struct from Objective-C classes.
Is this the right approach? Right now I am not sure how to access the hub from here and create the file.read/write
spans. If we want to mimic the swizzling in SentryNSDataSwizzling.m
, we would need access to the SentryNSDataSwizzling.shared.dataTracker
or similar
Closes #4546
Open Sub Tasks:
SentryNSDataTracker
toSentryFileIOTracker
SentryFileIOTrackingIntegrationTests.swift
Out-of-scope for this PR: