Skip to content
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

Swift 6 compatibility #440

Open
ikorich opened this issue Dec 18, 2024 · 2 comments
Open

Swift 6 compatibility #440

ikorich opened this issue Dec 18, 2024 · 2 comments

Comments

@ikorich
Copy link

ikorich commented Dec 18, 2024

Unable to use DropboxClientsManager.authorizedClient with Swift 6
error: Reference to class property 'authorizedClient' is not concurrency-safe because it involves shared mutable state

if set a build flag:

SWIFT_VERSION = 5.10
SWIFT_STRICT_CONCURRENCY = complete

you can find a warning: Reference to class property 'authorizedClient' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode

@greg-db
Copy link
Contributor

greg-db commented Dec 18, 2024

Thanks for the report! I'll ask the team to look into it.

@jboulter11
Copy link
Contributor

Thanks for bringing this up with us!

We've taken a look at this and we'd like to wait to migrate our code to strict concurrency until we see improvements like the ones listed in the vision doc here: https://github.com/hborla/swift-evolution/blob/approachable-concurrency-vision/visions/approachable-concurrency.md

We believe strict concurrency and swift 6 in general is still new and we'd like to wait to see what improvements can be made to specifically ease our use cases before we migrate.

We believe you should be able to use @preconcurrency to import our code and use it still. By doing this, you'll be taking ownership over ensuring all usages of our SDK are thread-safe, which we think was the intention when the code was written, given the global static variables. If you cannot do this for some reason, we'd love to hear about your use case so we can better understand the problem.

If we don't hear from you, we will still leave this issue open to be revisited later, as we agree that this work must be done at some point and it is important for the future of this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants