-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PubSub Javascript: How to detect websocket closed and reconnect? #4459
Comments
Having this issue too, any way to overcome this problem? |
It's really starting to become a problem for us, that we cannot in any way check the current connection status and reconnect in any reliable way. The simplest use case is a browser tab staying open while the user putting her computer to sleep, then resumes work without refreshing the UI/tab. The UI will stop providing realtime updates, and there's no way we have found, where we can even request a connection status. |
Also interested in tracking this! |
any updates on this? |
anyone found workaround for this. |
This seems to happen quite often. Any solutions? |
Some good news. Detecting socket status changes just got a whole lot easier with new Hub messages. Work is inflight to add automated reconnection. |
might want to check on the link you posted... |
Good catch. Thanks to @abdallahshaban557 for proactively fixing this! |
Reconnection is now staged on the With this change any disrupted connection will attempt to reconnect when possible. Reconnection can be expected to trigger 5 seconds after the resources to reconnect are available. If the network is disrupted in a way that can't be detected, reconnection will be attempted every minute until the connection is recovered. Note that missed messages will not backfill on recovery. If you need to trigger behavior to catch up missed messaged on recovery, this should be possible to implement using the connection state Hub messages released last month. |
Good news. Automated Reconnection is now available on the latest Please review our breaking change guidance before upgrading your application. To upgrade Amplify to version 5, run the following in your project folder:
Check With this behavior released, I am closing this issue as resolved. |
** Which Category is your question related to? **
PubSub Javascript(vue)
** What AWS Services are you utilizing? **
PubSub, IoT, Cognito(Unauth)
** Provide additional details e.g. code snippets **
Somehow my MQTT connection drops even after successfully subscribed a topic and send/receive messages.
How can I detect/monitor MQTT connection status? In other word, How can I access AWSIoTProvider created by Amplify.addPluggable?
After MQTT disconnect and even I unsubscribe then subscribe topic again, I cannot publish message any more with error "AMQJS0011E Invalid state not connected".
So far only solution is to reload page. Is there any better way to recover session?
The text was updated successfully, but these errors were encountered: