Skip to content

Sendable Conformance #231

@alobaili

Description

@alobaili

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA feature has been asked for or suggested by the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions