Closed danielspk closed 3 years ago
I am willing to make a pull request if someone can guide where the problem may be.
I can manage the ping issue outside the project, but it is essential that any disconnection error can be managed by the error handler and this does not happen. There are soft disconnects that are not caught.
Thanks.
Apparently my problem has to do with the device going into "sleep" mode. I see that this issue was dealt with many times in closed issues. What recommendation do you give me when I receive the message "asleep"?
Thanks.
Do I reconnect the session? NO Is there any other way to get back online? User has to open WhatsApp on his device Should I wait for the device to be online again without taking any action YES (I think that is what WhatsApp Web does when it shows the yellow warning message - it simply informs it without taking any action) TRUE
Thanks for your help @beshoo
Hello.
I have a goroutine that tries to reconnect sessions when a ping fails (every minute). Sometimes I get strange behavior as for several consecutive retries I get the error message "restore session connection timed out" but then on subsequent retries the connection can be successfully reestablished. What could be causing those timeouts?
Handler.HandleError()
does not run with any kind of error (ErrConnectionFailed
orErrConnectionClosed
orErrConnectionTimeout
). I detect the disconnection usingConn.AdminTest()
which returns the error "connection timed out"