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

Incorrect functionality when device is offline, user is signed-in and application is launched #203

Open
2 tasks done
pmellaaho opened this issue Nov 28, 2024 · 1 comment
Labels
authenticator This issue relates to the Authenticator component bug Something isn't working

Comments

@pmellaaho
Copy link

Before creating a new issue, please confirm:

Which UI component?

Authenticator

Gradle script dependencies

// Put output below this line
authenticatorVersion = "1.3.0"

Environment information

# Put output below this line
Gradle 8.9

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

When steps described below are followed, only ambigious "Sorry, something went wrong" -message is shown to the user by Amplify-UI i.e. the Application does not get to show any content at all. Furthermore, the only way to recover from this state is to set the device back online and then killing the app and launching it again.

With AndroidLoggingPlugin enabled I can see the following exception in Logcat:
InvalidUserPoolConfigurationException, which seems incorrect.

Reproduction steps (if applicable)

  1. Sign-in to the App
  2. Set device offline
  3. Kill the App
  4. Wait for access token to expire
  5. Launch the App

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line
RefreshUserPoolTokens Sending event ThrowError
Auth State Change: Configured(authNState=SignedIn(signedInData=SignedInData(userId=<userId>, username=<username>, signedInDate=Thu Nov 28 07:56:43 GMT+02:00 2024, signInMethod=ApiBased(authType=USER_SRP_AUTH), cognitoUserPoolTokens=CognitoUserPoolTokens(idToken = eyJra***, accessToken = eyJra***, refreshToken = eyJjd***)), deviceMetadata=com.amplifyframework.statemachine.codegen.data.DeviceMetadata$Empty@d223312), authZState=Error(exception=SessionError(exception=aws.smithy.kotlin.runtime.http.HttpException: java.net.UnknownHostException: Unable to resolve host "cognito-idp.eu-central-1.amazonaws.com": No address associated with hostname, amplifyCredential=UserPool(signedInData=SignedInData(userId=<userId>, username=<username>, signedInDate=Thu Nov 28 07:56:43 GMT+02:00 2024, signInMethod=ApiBased(authType=USER_SRP_AUTH), cognitoUserPoolTokens=CognitoUserPoolTokens(idToken = eyJra***, accessToken = eyJra***, refreshToken = eyJjd***))))))
InvalidUserPoolConfigurationException{message=The user pool configuration is missing or invalid., cause=null, recoverySuggestion=Please check the user pool configuration in your amplifyconfiguration.json file.}

amplifyconfiguration.json

No response

Additional information and screenshots

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 Nov 28, 2024
@mattcreaser mattcreaser added bug Something isn't working authenticator This issue relates to the Authenticator component labels Nov 28, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label Nov 28, 2024
@mattcreaser
Copy link
Member

Thanks for the report @pmellaaho. It looks like Amplify cannot refresh the tokens because the device is offline, but is returning an incorrect error - we'll have to investigate on the Amplify side for that.

For Authenticator there are two things to look at here:

  • Although the access token is expired, the user is still "signed in" so it should be able to go to the signed-in state.
  • There should probably be a retry button on the general exception UI so that user could recover if the device comes back online.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authenticator This issue relates to the Authenticator component bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants