amplify-flutter
amplify-flutter copied to clipboard
feat(api): Subscription Reconnection
Issue #, if available:
Description of changes: Provides GraphQL subscription reconnection and associated quality of life additions.
- Introduces a reconnection strategy for GraphQL Subscription web sockets.
- Monitors hardware level network changes to trigger reconnect on resume (wifi on/off, wifi to mobile, airplane mode, etc).
- Utilizes an exponential back off strategy when attempting to reconnect.
- Exposes configuration options for this retry strategy at plugin init time.
- Introduces Hub Events to allow tracking of connection status. Statuses include: -- Connected The network is connected and has active subscriptions. -- Connecting - The network is disconnected and has active subscriptions. Triggers for initial connect and reconnect events. -- PendingDisconnect - The network is connected, but has no active subscriptions. -- Disconnected - The network has been disconnected and no active subscriptions. -- Failed - The network could not be connected.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.