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

Amplify.Auth does not Sendable conform, will this be solved until release of Swift 6? #3828

Open
tscholze opened this issue Aug 22, 2024 · 7 comments
Labels
core Amplify Core components feature-request Request a new feature follow up Requires follow up from maintainers

Comments

@tscholze
Copy link

tscholze commented Aug 22, 2024

Describe the bug

Regarding using Amplify.Auth in SwiftUI with Swift 5.10, there will be warnings over all the place because some of the Auth's classes, protocols, etc. are not actor'ized.

This will lead to compilation errors in Swift 6 but currently there will be a lot of warnings that may break CI checks for warning threshold.

If this can be solved in the client app, please let me know.

Steps To Reproduce

Steps to reproduce the behavior:
1. Create a SwiftUI project
2. Embed `2.36.0` of Amplify iOS SDK
3. Use methods like `_ = await Amplify.Auth.signOut()`
4. See warnings (Swift 5) or errors (Swift 6)

> Non-sendable type 'any AuthSignOutResult' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary

Expected behavior

Amplify.Auth works fine with SwiftUI, actors

Amplify Framework Version

2.36.0

Amplify Categories

Auth

Dependency manager

Swift PM

Swift version

5.10

CLI version

not installed - iOS only

Xcode version

Version 15.4 (15F31d)

Relevant log output

<details>
<summary>Log Messages</summary>
No logs
</details>

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

iOS 17

Device

all

Specific to simulators

no

Additional context

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Aug 22, 2024
@tscholze tscholze changed the title Amplify.Auth not Sendable conform, will this be solved until release of Swift 6? Amplify.Auth does not Sendable conform, will this be solved until release of Swift 6? Aug 22, 2024
@harsh62
Copy link
Member

harsh62 commented Aug 22, 2024

Thanks for raising the concern. Our team will look into prioritizing this request.

@harsh62 harsh62 added core Amplify Core components feature-request Request a new feature follow up Requires follow up from maintainers and removed pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Aug 22, 2024
Copy link
Contributor

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@MMise
Copy link

MMise commented Sep 5, 2024

Reference to class property 'Auth' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6 is also shown from a line such as

let result = await Amplify.Auth.signOut()

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 5, 2024
@5d
Copy link
Member

5d commented Sep 5, 2024

Reference to class property 'Auth' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6 is also shown from a line such as

let result = await Amplify.Auth.signOut()

Hi @MMise ,
I tested with a sample app using Xcode Version 15.4 (15F31d) but couldn't reproduce the warning message. Which version of Xcode are you using?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 5, 2024
@tscholze
Copy link
Author

tscholze commented Oct 7, 2024

Is there any update on this issue?

@5d did you enable the Swift 6 warnings? :)

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 7, 2024
@MMise
Copy link

MMise commented Oct 7, 2024

@5d I am using Xcode 15.3 with Strict Concurrency Checking set to Complete

@thisisabhash
Copy link
Member

Thank you for your patience - our team will take a look and post updates here.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Amplify Core components feature-request Request a new feature follow up Requires follow up from maintainers
Projects
None yet
Development

No branches or pull requests

5 participants