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

Resending of the messages missed in the subscription #370

Open
chorniyn opened this issue Oct 14, 2021 · 0 comments
Open

Resending of the messages missed in the subscription #370

chorniyn opened this issue Oct 14, 2021 · 0 comments
Labels
feature-request Request a new feature

Comments

@chorniyn
Copy link

Is it possible to configure the AppSync subscription mechanism to resend the messages missed due to the transport (internet connection) problems?

The use case:

  1. The subscription is established using the AWSAppSyncClient configured with OIDC Auth provider.
  2. Internet connection is lost for a while (wi-fi is turned off)
  3. During this time some mutations A and B happen which must trigger the subscription
  4. Internet connection is restored (wi-fi is turn on)
  5. Mutations A and B never get delivered though

The code is

val sub: SubscribeToNewMessageSubscription = SubscribeToNewMessageSubscription.builder().conversationId(channelID).build()
val cb = object : AppSyncSubscriptionCall.Callback<SubscribeToNewMessageSubscription.Data> {
    override fun onResponse(response: Response<SubscribeToNewMessageSubscription.Data>) {
        Log.i("sub_test", "got response")
    }
    override fun onFailure(e: ApolloException) {
        Log.e("sub_test", "got failure", e)
    }
    override fun onCompleted() {
        Log.e("sub_test", "completed")
    }
}
val client: AWSAppSyncClient = oidcAppSyncClient
client.subscribe(sub).execute(cb)

Logs

18:40:54.482 15859-15859 I/sub_test: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: , failover: false, available: true, roaming: false]
18:43:03.153 15859-19998 I/sub_test: got response
18:43:29.216 15859-15859 I/sub_test: [type: WIFI[], state: DISCONNECTED/DISCONNECTED, reason: (unspecified), extra: (none), failover: false, available: true, roaming: false]
18:43:29.253 15859-19998 E/sub_test: got failure
com.apollographql.apollo.exception.ApolloException: Subscription failed.
        at com.amazonaws.mobileconnectors.appsync.WebSocketConnectionManager.notifyFailure(WebSocketConnectionManager.java:345)
        at com.amazonaws.mobileconnectors.appsync.WebSocketConnectionManager.access$700(WebSocketConnectionManager.java:45)
        at com.amazonaws.mobileconnectors.appsync.WebSocketConnectionManager$1.onFailure(WebSocketConnectionManager.java:169)
     Caused by: java.net.SocketException: Software caused connection abort
18:43:29.509 15859-21248 E/sub_test: got failure ...
18:43:29.515 15859-21240 E/sub_test: got failure ...
18:43:30.010 15859-21251 E/sub_test: got failure ...
18:43:30.022 15859-21240 E/sub_test: got failure ...
18:43:30.889 15859-21252 E/sub_test: got failure ...
18:43:30.893 15859-21240 E/sub_test: got failure ...
18:43:32.607 15859-21260 E/sub_test: got failure ...
18:43:32.611 15859-21240 E/sub_test: got failure ...
18:43:35.868 15859-21268 E/sub_test: got failure ...
18:43:42.351 15859-21280 E/sub_test: got failure ...
18:43:55.283 15859-21296 E/sub_test: got failure ...
18:44:20.984 15859-21590 E/sub_test: got failure ...

HERE TWO NEW MUTATIONS WERE PRODUCED

2021-10-14 18:44:23.462 15859-15859/com.ehawk.repath.dev I/sub_test: [type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: , failover: false, available: true, roaming: false]

BUT THOSE 2 MUTATIONS WEREN'T RECEIVED AFTER CONNECTION RESTORE

Environment
AppSync SDK Version: 3.2.0

Device Information:

  • Device: Samsung s21
  • Android Version: 11
@gpanshu gpanshu added the pending-triage Issue is pending triage label May 1, 2023
@tjleing tjleing added feature-request Request a new feature and removed pending-triage Issue is pending triage labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

3 participants