Open xvarlez opened 4 years ago
Hi @xvarlez - thanks for the report. I believe this report is accurate. Amplify Android contains WebSocket subscription code, as well. And I recall that we added support for connection_error
type messages, in it. But, this AppSync code base may not have received the same update, yet.
HI @jamesonwilliams
Thanks for your reply. Are there any plans to update the AppSync SDK soon with those changes?
Describe the bug
Hi,
I am having trouble using the subscriptions. It looks like when there is a network failure and the WebSocket connection gets lost, the subsequent subscriptions will just fail silently (
onFailure()
doesn't get called).To Reproduce
Scenario 1
notifyFailure()
In this scenario, my
onFailure()
callback never gets called. From looking inWebSocketConnectionManager
, it looks like you're trying to call it too soon, when my subscription has not yet been added to thesubscriptions
Map.Scenario 2
notifyFailure()
onFailure()
callbacks are properly calledHere again,
onFailure()
doesn’t get called. So you think the subscription has been successfully created, however it has not and I am not receiving any data on it.Expected behavior
onFailure()
should get called if the subscription has not been successfully createdEnvironment(please complete the following information):
Device Information (please complete the following information):
Additional context
Looking at the
WebSocketConnectionManager
class it looks like you never try to reestablish the WebSocket connection in case of failure. The subsequent calls are just queued despite the connection being lost. I believe the connection should be closed and reattempted in case of failure?