Amplify-android: Error on re-subscription

Created on 17 Jun 2020  路  2Comments  路  Source: aws-amplify/amplify-android

After cancelling a subscription in onDestroy of MainActivity and restarting the application, if we subscribe again, the following error is thrown -

AmplifyException {message=Subscription not acknowledged., cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.SubscriptionEndpoint$Subscription.awaitSubscriptionReady(SubscriptionEndpoint.java:2)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:99)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0(SubscriptionOperation.java:4)
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(Unknown Source:2)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

I assure you that there is no issue with internet connectivity.

Also, the same error is thrown when trying to subscribe after the internet connection is re-established.

Steps to reproduce -

  1. Initialize Amplify and subscribe, in the onCreate method of activity.
  2. Turn off the internet connection. onSubscriptionFailure is called.
  3. Turn on the internet connection. Once the connection is established, then subscribe again.
  4. After 10 seconds, the above mentioned error is thrown.
Bug DataStore

Most helpful comment

Apologies for the delay on this. I am actively focused on a fix for this issue. Will provide an update ASAP.

All 2 comments

Apologies for the delay on this. I am actively focused on a fix for this issue. Will provide an update ASAP.

A new version (1.1.0) has just been released that includes a fix (a retry strategy with backoff when subscription fails) for this. If you encounter this error, feel free to re-open this issue.

Was this page helpful?
0 / 5 - 0 ratings