AcmeSwift icon indicating copy to clipboard operation
AcmeSwift copied to clipboard

Added Sendable to public structs and enums

Open fizker opened this issue 1 year ago • 1 comments

I was in the process of prepping my app for having 0 warnings from SwiftSetting.enableExperimentalFeature("StrictConcurrency"), and some Sendable issues surfaced from AcmeSwift.

Adding Sendable to most public enums and structs made the warnings go away, without introducing new ones.

I could not add Sendable to AccountCredentials because it references Crypto.P256.Signing.PrivateKey which is not Sendable yet.

I also tried bumping the swift-tools-version to 5.10 and applying StrictConcurrency to this project, and no warnings were raised. I did not add this to the PR, because I am not sure when you want to bump the required version of Swift.

fizker avatar Mar 16 '24 14:03 fizker

I could not add Sendable to AccountCredentials because it references Crypto.P256.Signing.PrivateKey which is not Sendable yet.

We might want to either prefix the import with @preconcurrency, or tag AccountCredentials as @unchecked Sendable, since PrivateKey is a non-mutable struct and should be safe to use in this scenario.

dimitribouniol avatar May 19 '24 09:05 dimitribouniol

Is this something you want me to do in this PR, or would it make more sense to take these changes as-is and revisit the leftovers later?

fizker avatar May 21 '24 09:05 fizker

I'm happy to take these changes as-is, just need to take a few moments to test and validate

m-barthelemy avatar May 21 '24 10:05 m-barthelemy

Is this something you want me to do in this PR, or would it make more sense to take these changes as-is and revisit the leftovers later?

Thanks for your PR. You are very welcome to "revisit the leftovers" any time!

m-barthelemy avatar May 21 '24 22:05 m-barthelemy