aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.43k stars 2.13k forks source link

API.graphql subscriptions stop receiving data across network changes #11818

Open stocaaro opened 1 year ago

stocaaro commented 1 year ago

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

GraphQL API

Is this related to another service?

AppSync

Describe the feature you'd like to request

The API GraphQL subscription behavior should continue to receive updates (or be reconnected) across IP address changes.

The device/browser IP address may change when moving between wifi or cellular networks. When this occurs, either:

  1. The websocket should remain active and uninterrupted.
  2. The websocket should be disconnected immediately prompting reconnection.

Describe the solution you'd like

AppSync should continue to send data to websockets across IP address changes.

Describe alternatives you've considered

The Amplify client should recognize when the AppSync subscription is broken either by watching for IP address changes or because AppSync sends error messages that will trigger the errant connection to close. In both cases the client should automatically reconnect.

Additional context

Reproduction steps:

Note that in connection states this ip address transition doesn't cause the network to be unavailable in my testing. The connection issue is that we miss Keep Alive messages following the IP address change.

Is this something that you'd be interested in working on?

cwomack commented 1 year ago

Thanks for opening this issue, @stocaaro. We'll review this internally and provides updates on any progress as soon as we can.

sam-decida commented 9 months ago

Is there any update to this issue? I'm also running into the same issue.