Open
Description
Describe the bug
Enabling Dynamic Actor Isolation feature for Swift 6 Language mode in project causes app crash.
- App crashes when using AWSCloudWatchLoggingPlugin
To Reproduce
- Enable
Dynamic Actor Isolation
feature for Swift language 6 mode in project - Configure AWS Cloud Watch Logging using below code
public func configureAuthSDK() {
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
try Amplify.add(plugin: AWSCloudWatchLoggingPlugin())
try Amplify.configure()
} catch {
}
}
- Run the app and it crashes
❗ Key Concurrency Problem:
- self is captured implicitly by the Task.
- The enclosing object (self) may not be available safely within the Task, unless it’s explicitly isolated (@mainactor, @sendable, etc.).
- Also, the closure passed as @autoclosure () -> String could be capturing non-Sendable context if used inside a concurrent task.