papyrus icon indicating copy to clipboard operation
papyrus copied to clipboard

Fix strict concurrency warnings

Open kevin-kp opened this issue 1 year ago • 4 comments

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.

kevin-kp avatar Jun 12 '24 09:06 kevin-kp

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?

joshuawright11 avatar Jun 12 '24 15:06 joshuawright11

LGTM - feel free to change from Draft to Open and I'll approve

joshuawright11 avatar Jun 13 '24 13:06 joshuawright11

@joshuawright11 it actually isn't ready yet as the Provider is still not Sendable (which i'm currently getting warnings from).

kevin-kp avatar Jun 14 '24 11:06 kevin-kp

@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

kevin-kp avatar Jul 11 '24 17:07 kevin-kp

Any updates to this PR? @kevin-kp @joshuawright11 do you guys need any help?

lutes1 avatar May 14 '25 12:05 lutes1

@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

kevin-kp avatar May 15 '25 07:05 kevin-kp

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

lutes1 avatar May 15 '25 08:05 lutes1

Closing this PR in favor of https://github.com/joshuawright11/papyrus/pull/72

kevin-kp avatar May 19 '25 12:05 kevin-kp