-
Notifications
You must be signed in to change notification settings - Fork 100
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
Connection resumed after long downtime, but no messages received #475
Comments
@bretambrose Do you know if this is by design or if this is a bug? I encountered the same issue today but it behaved differently. After MQTT resumed the connection, it took around 5 minutes until I started receiving messages. I even tried unsubscribing and subscribing to the same topic without any luck. It does feel like an internal bug since unsubbing and subbing again to the topic had no effect. Is there a way to turn on internal debug logging? (on browser) |
The SDK does not perform resubscription for you. Resubscription sounds easy but quickly devolves into edge cases. Ultimately, it feels like a correct application will still need to handle the edge case where resubscription fails anyways. The browser variant is a wrapper around mqtt-js, so debug logging turns into interacting with its logging facilities (which in my experience are very unsatisfactory). I have the following in my notes from years ago, no guarantees, I have memories that every time I've tried to do this it's been an annoying/unfruitful process:
|
There will always be edge cases for reconnecting that will need to be handled correctly. This feature isn't something we are currently planning on implementing because of resource constraints. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
My issue is 100% like #117 which is now closed.
Based on the information on the old issue that I referenced, it says I need to manually re-subscribe if
session_present
is false when the connection is resumed inconnection_success
My initial thought was that this library would handle the re-connection by itself.I tried debugging the internal state and saw that the connection_count increases with time, when network is down and goes up after several hours. Is it because a new session was created?
I would love to have more information on this.
Thanks!
Expected Behavior
I expected the connection to resume without any silent failure.
Current Behavior
The connection is resumed but no messages are received
Reproduction Steps
Possible Solution
Re-subscribe to the topics automatically if re-connection is handled by this SDK.
Additional Information/Context
Using browser version
SDK version used
1.19.1
Environment details (OS name and version, etc.)
Browser Chrome on MacOS
The text was updated successfully, but these errors were encountered: