Convert dispatch queue wrapper#5459
Conversation
5c845bd to
64cea2a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5459 +/- ##
=============================================
+ Coverage 86.238% 86.248% +0.010%
=============================================
Files 399 399
Lines 34814 34818 +4
Branches 15097 15098 +1
=============================================
+ Hits 30023 30030 +7
Misses 4744 4744
+ Partials 47 44 -3
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
08bf4a4 to
09a3620
Compare
Performance metrics 🚀
|
53a4e2c to
0bdf842
Compare
73f43a7 to
0cefa2e
Compare
philprime
left a comment
There was a problem hiding this comment.
Found a couple of issues to look into
60f4843 to
36a8c7f
Compare
6d76682 to
322dcd3
Compare
b676d58 to
0ebd0f2
Compare
0ebd0f2 to
e96866d
Compare
🚨 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.
Thanks a lot for trying to convert more code to Swift. Unfortunately, I don't think we can do such a refactoring in one go. The risk is way too high to break things. The SentryDispatchQueueWrapper is heavily used in the SDK, and we don't have enough integration tests to ensure migrating this won't introduce any significant issues. If we mess this up, the whole SDK can be broken.
I would instead choose an opportunistic approach. I would create a duplicate class in Swift for the SentryDispatchQueueWrapper. Whenever we need parts from the SentryDispatchQueueWrapper in Swift, we add it. Once we know it's working correctly, we can let ObjC code use the new Swift class step by step. It might be OK, to keep a SentryDispatchQueueWrapper for specific parts of the SDK.
Does that make sense, @noahsmartin?
|
#5472 replaces this PR due to the concerns pointed out in #5459 (review). That's why we closed it. |
📜 Description
Convert SentryDispatchQueueWrapper to Swift
dispatch_once doesn't have a Swift equivalent but the wrapper was only used in one place, so I just converted that to be used directly with a check for if tests are trying to override it with a stub.
Also the legacy queue priority is not replaced with QoS in Swift. I created new initializers for utility and userInitiated, which are the only QoS that was being used from the objc queue attributes.
#skip-changelog
💚 How did you test it?
Updated existing tests
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.