aws-amplify / aws-amplify/amplify-data
API.graphql subscriptions stop receiving data across network changes
- Dominant language
- TypeScript
- Stars
- 18
- Forks
- 23
- Avg merge
- 26m
- Merged PRs (30d)
- 1
Description
### 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:
- Setup an application with an [API subscription](https://docs.amplify.aws/lib/graphqlapi/subscribe-data/q/platform/js/) following data updates
- Confirm that under normal conditions updates are received as expected
- Simulate that when the device IP address changes, the websocket remains, but no longer receives updates.
- Simulate IP address change by either logging in to or disconnecting from a VPN
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?
- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change
Contributor guide
Research direction
Start with the GraphQL subscription setup described in the linked Amplify documentation and reproduce the issue by changing networks or toggling a VPN while updates are streaming. Trace how the client handles missed keep-alive messages and define done as subscriptions continuing to receive updates or reconnecting automatically after an IP change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100