-
Notifications
You must be signed in to change notification settings - Fork 195
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
AWSCloudWatchLoggingCategoryClient asks for Current User Identifier During Configuration (CRASH) #3897
Comments
Hello,
Then you can setup
|
Thank you so much for the quick response @thisisabhash, we are not using the CLI and Auth is already setup. I think the main culprit seems to be this:
|
@Hartistic Can you share where |
Absolutely @harsh62, and thank you guys so much, Im actually hoping I am just doing something out of order and that this is an easy resolution. We have a SwiftUI Application. 1). On App Launch:
|
Got it and why do you suspect that the following snippet is a problem?
From what I see is that the Auth plugin is being configured before the logging plugin, so this snippet should work, because Auth is already configured. Are you able to share symbolicated crash log too? |
@harsh62 absolutely, I cannot share it on this thread, could I share it with you privately somehow? |
@harsh62 my crash backtraces lead back to that code block. |
@harsh62 I work with @Hartistic ... IIRC the issue has to do with CloudWatch asking Auth for the user id and it's doing it in a way that when Auth gets an error because we don't have a UserPool it crashes. We're using Identity Pools only for federated logins using Sign in with Apple (no User Pools) |
@harsh62 my Slack is: Crash Message : Thread 14: Fatal error: Authentication category is not configured. Call Amplify.configure() before using any methods on the category. |
Describe the bug
While configuring Amplify with an AWSCloudWatchLoggingPluginConfiguration and an AWSCognitoAuthPlugin configuration the library has a race condition that crashes the application 50% of the time with an error of
Thread 20: Fatal error: Authentication category is not configured. Call Amplify.configure() before using any methods on the category.
The problem is that these two configurations are added to Amplify and this crash occurs when calling Amplify.configure().
Order of Methods that causes crash to occur:
try configure(CategoryType.logging.category, using: resolvedConfiguration)
try configurable.configure(using: configuration)
try configure(using: categoryConfiguration(from: amplifyConfiguration))
try Amplify.configure(plugins: Array(plugins.values), using: configuration)
try plugin.configure(using: pluginConfiguration)
Steps To Reproduce
Expected behavior
The AWSCloudWatchLoggingPluginConfiguration shouldn't be asking for Authentication details during it's configuration...the library says you can only call configure() once, so configuring Auth and then Logging isn't possible.
Amplify Framework Version
2.41.1
Amplify Categories
Analytics, API, Auth
Dependency manager
Swift PM
Swift version
5.8.0
CLI version
I am not sure
Xcode version
16.0
Relevant log output
No response
Is this a regression?
Yes
Regression additional context
No response
Platforms
iOS
OS Version
IOS 18
Device
iPhone 15 Pro Max
Specific to simulators
no
Additional context
No response
The text was updated successfully, but these errors were encountered: