-
-
Notifications
You must be signed in to change notification settings - Fork 376
refactor: Convert SentryCoreDataTrackingIntegration to Swift
#7255
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?
refactor: Convert SentryCoreDataTrackingIntegration to Swift
#7255
Conversation
…for swizzling functionality
…trackingintegrationm-in-swift_2
…nd SentryNSFileManagerSwizzling
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7255 +/- ##
=============================================
+ Coverage 85.025% 85.032% +0.006%
=============================================
Files 471 472 +1
Lines 28388 28401 +13
Branches 12463 12470 +7
=============================================
+ Hits 24137 24150 +13
+ Misses 4204 4202 -2
- Partials 47 49 +2
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
…nner/cocoa-988-refactor-sentrycoredatatrackingintegrationm-in-swift
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 83bf9af | 1213.30 ms | 1234.18 ms | 20.89 ms |
| 5d67f5d | 1225.33 ms | 1262.76 ms | 37.43 ms |
| e01eafa | 1223.36 ms | 1252.43 ms | 29.07 ms |
| 86b8951 | 1211.20 ms | 1247.92 ms | 36.72 ms |
| 9a0a3cd | 1220.85 ms | 1243.69 ms | 22.83 ms |
| e701dc8 | 1215.89 ms | 1254.06 ms | 38.17 ms |
| fd24b7c | 1222.39 ms | 1259.67 ms | 37.28 ms |
| 013fd4d | 1216.02 ms | 1242.16 ms | 26.14 ms |
| 0d145c3 | 1224.04 ms | 1255.34 ms | 31.30 ms |
| 37bc095 | 1210.00 ms | 1242.69 ms | 32.69 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 83bf9af | 24.14 KiB | 1.04 MiB | 1.02 MiB |
| 5d67f5d | 24.14 KiB | 1.06 MiB | 1.04 MiB |
| e01eafa | 24.14 KiB | 1.07 MiB | 1.04 MiB |
| 86b8951 | 24.14 KiB | 1.08 MiB | 1.06 MiB |
| 9a0a3cd | 24.14 KiB | 1.08 MiB | 1.06 MiB |
| e701dc8 | 24.14 KiB | 1.06 MiB | 1.04 MiB |
| fd24b7c | 24.14 KiB | 1.07 MiB | 1.04 MiB |
| 013fd4d | 24.14 KiB | 1.04 MiB | 1.02 MiB |
| 0d145c3 | 24.14 KiB | 1.07 MiB | 1.05 MiB |
| 37bc095 | 24.14 KiB | 1.06 MiB | 1.04 MiB |
Previous results on branch: itaybrenner/cocoa-988-refactor-sentrycoredatatrackingintegrationm-in-swift
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7c41873 | 1212.56 ms | 1239.45 ms | 26.88 ms |
| 6736902 | 1223.02 ms | 1250.51 ms | 27.49 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7c41873 | 24.14 KiB | 1.08 MiB | 1.06 MiB |
| 6736902 | 24.14 KiB | 1.08 MiB | 1.06 MiB |
…nner/cocoa-988-refactor-sentrycoredatatrackingintegrationm-in-swift
…nner/cocoa-988-refactor-sentrycoredatatrackingintegrationm-in-swift
🚨 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:
|
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| originalImp:^NSArray *(NSFetchRequest *request, NSError **outError) { | ||
| return SentrySWCallOriginal(request, outError); | ||
| }] | ||
| : SentrySWCallOriginal(originalRequest, error); |
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.
Race condition when accessing weak tracker reference twice
Medium Severity
The __weak static _tracker variable is accessed twice in the ternary expression: once for the nil check and once for the method call. Between these accesses, the tracker could be deallocated on another thread, causing the second access to return nil. This would result in the message being sent to nil, returning nil/NO instead of calling the original Core Data implementation. The old code avoided this by capturing the weak reference into a local strong variable first. This could cause fetch operations to silently return empty results or save operations to report false failures.
📜 Description
Not ready for review yet
💡 Motivation and Context
Swift conversion
💚 How did you test it?
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.#skip-changelog
Closes #7275