Go-whatsapp: error logging in: restoring failed: restore session connection timed out

Created on 23 Jul 2018  ·  3Comments  ·  Source: Rhymen/go-whatsapp

After I removed the whatsapp web session on the phone, the go-whatsapp became unusable.

I'm not a go developer, so I can understand the source, but the architecture I have no idea. Where is the session saved?

Most helpful comment

If the session gets taken over by another client, you will get a disconnect message via the JsonHandler and the websocket get closed afterwards. The closing of the socket gets communicated via the HandleError function.

All 3 comments

The library does not save the session anywhere, instead it is returned by the login and restoreSession function. If you use the code that is provided by the example section, the session is saved in os.TempDir() and is called _whatsappSession.gob_

See https://golang.org/pkg/os/#TempDir

Thank you! Yes, I was using the sample code. Now I'm trying to implement a detection of disconnected and terminated sections. The Whatsapp Web realizes the difference, but the examples provided do not.

Disconnected session
image

Closed session
image

If the session gets taken over by another client, you will get a disconnect message via the JsonHandler and the websocket get closed afterwards. The closing of the socket gets communicated via the HandleError function.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xnodcorp picture xnodcorp  ·  3Comments

denislee picture denislee  ·  6Comments

Valdenirmezadri picture Valdenirmezadri  ·  7Comments

sbruder picture sbruder  ·  9Comments

lutpiero picture lutpiero  ·  8Comments