-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
feature-requestRequest a new featureRequest a new feature
Description
Is it possible to configure the AppSync subscription mechanism to resend the messages missed due to the transport (internet connection) problems?
The use case:
- The subscription is established using the
AWSAppSyncClientconfigured with OIDC Auth provider. - Internet connection is lost for a while (wi-fi is turned off)
- During this time some mutations A and B happen which must trigger the subscription
- Internet connection is restored (wi-fi is turn on)
- 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
Metadata
Metadata
Assignees
Labels
feature-requestRequest a new featureRequest a new feature