papyrus
papyrus copied to clipboard
Fix strict concurrency warnings
This PR is an effort to fix the strict concurrency warnings when adding the swift setting StrictConcurrency (not included in the commit).
You can test this by adding the following to the necessary targets:
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]
The only two warnings that are left are HTTPBodyEncoder and HTTPBodyDecoder.
This is because Sendable conformance is iOS >= 16.0 for JSONEncoder and JSONDecoder and I'm not sure what the best approach is to resolve these two warnings.
Thanks @kevin-kp! Great work 💯 couple Qs for you - (caveat - I haven't dived into Sendable a ton yet so they may just be misunderstandings on my part.)
Regarding JSONEncoder - would a @preconcurrency import Foundation work for versions less than iOS 16?
LGTM - feel free to change from Draft to Open and I'll approve
@joshuawright11 it actually isn't ready yet as the Provider is still not Sendable (which i'm currently getting warnings from).
@joshuawright11 sorry for the delay, I had doubts of making provider an actor so I created a mutex instead. I haven't done extensive tests as I got the issue mentioned in https://github.com/joshuawright11/papyrus/issues/59 which popped up when updating from 0.6.10 to 0.6.16
Any updates to this PR? @kevin-kp @joshuawright11 do you guys need any help?
@lutes1 As I didn't receive any response anymore, I just fixed the issues on the main branch of my fork and use that one instead
Ah, do you mind creating another PR from your main branch? Maybe we can get @joshuawright11 to merge it and continue to maintain this repo.
I think it's important for this repo to succeed considering the state of api clients in Swift
Closing this PR in favor of https://github.com/joshuawright11/papyrus/pull/72