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

Sendable Conformance #231

Open
4 tasks done
alobaili opened this issue Nov 26, 2024 · 1 comment · May be fixed by #235
Open
4 tasks done

Sendable Conformance #231

alobaili opened this issue Nov 26, 2024 · 1 comment · May be fixed by #235
Labels
feature request A feature has been asked for or suggested by the community

Comments

@alobaili
Copy link

Checklist

  • I have looked into the Readme and the Examples, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

Creating a stored property of type SimpleKeychain in a final class conforming to Sendable produces a compile time error in Swift 6. Here'e the minimum code:

import SimpleKeychain

final class TokenManager: Sendable {
    private let keychain = SimpleKeychain()
}

The above code produces the error:

Stored property 'keychain' of 'Sendable'-conforming class 'TokenManager' has non-sendable type 'SimpleKeychain'

Describe the ideal solution

SimpleKeychain should be reviewed against Swift 6 concurrency checks and be marked Sendable.

The above minimum code should compile in Swift 6.

Alternatives and current workarounds

I can add @preconcurrency to the import statement to silent all errors and warnings, but this is not ideal and simply hides the issues and data-race risks.

Additional context

I'm trying to use SimpleKeychain in a class that handles storing and retrieving all sensitive strings in Keychain.

@alobaili alobaili added the feature request A feature has been asked for or suggested by the community label Nov 26, 2024
@Widcket
Copy link
Contributor

Widcket commented Jan 15, 2025

Hi @alobaili, I'm working on this and should be able to have a PR up soon.

@Widcket Widcket linked a pull request Jan 16, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants