Go-whatsapp: Disconnected after 24 hour with 1000 error status

Created on 10 Nov 2020  Â·  19Comments  Â·  Source: Rhymen/go-whatsapp

Hi all,
I wonder what is the meaning of the error 1000

ErrConnectionClosed server closed connection,code: 1000,text
What is that's mean.? And should l rescan the QRcode?

UPDATE
I rescanned he QR code at 2020-11-11 14:16:56
and at 2020-11-12 17:29:20 I got disconnection!
Regard

All 19 comments

It is when you end the session directly on the device, it is necessary to read the qrcode again.

But the problem that l did not end the sessions on the device. I just got
the error message....

And l did not open whatsapp web on chrome.

Strange 😳

On Tue, 10 Nov 2020, 11:23 pm Bruno Ferreira, notifications@github.com
wrote:

It is when you end the session directly on the device, it is necessary to
read the qrcode again.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Rhymen/go-whatsapp/issues/476#issuecomment-724975000,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABDLT2Z3ZESUGKFWEESWSVTSPGVN7ANCNFSM4TRFOGGQ
.

Hey, I really think it is related to version updates of WhatsApp Web.
They do a stepped rollout.

Hey, I really think it is related to version updates of WhatsApp Web.
They do a stepped rollout.

I am not sure that it related.
The WhatsApp Web Version which i have in the Go is : 2.2045.15
Now I scanned my number at
2020-11-11 14:16:56
and at 2020-11-12 17:29:20 I got disconnection!
What do you think ?

Once the server disconnected the Go memeory status is
Alloc = 4 MiB TotalAlloc = 29 MiB Sys = 22 MiB NumGC = 142

I have the same problem, I have to restart the services every 24 hours.

I have the same problem, I have to restart the services every 24 hours.

Strange do you believe it is IP Problem?

I have the same problem, I have to restart the services every 24 hours.

Strange do you believe it is IP Problem?

I didn't make any IP changes at the moment, sometimes restoring the session corrects the problem.

I am not talking about restoring the session... it is just disconnected by it self!

I do receive this same error even when my number is connected less than 24 hours and also when having a new session created.
Re-reading QRCode is not required to recover from this. I just restart the application.

My previous comment about version updates may be just by coincidence.

Hey, I really think it is related to version updates of WhatsApp Web.
They do a stepped rollout.

Why I don't have the same problem with my Chrome session!

I do receive this same error even when my number is connected less than 24 hours and also when having a new session created.
Re-reading QRCode is not required to recover from this. I just restart the application.

My previous comment about version updates may be just by coincidence.

The 1000 error means you lost the session between WhatsApp and your device! @brunoferreiras

Maybe the WhatsApp servers are rebooting? I haven't looked into this issue...
Can you restore the session? If so, you could catch the error via HandleError and restore the session. You are disconnected only for a couple of seconds

@SchulteMK thank you for the steep by.
Well, my program deletes the session when it got "ErrConnectionClosed".... which indicates there is a connection problem which not related to the session.
I scanned the QR and saved the session on another file. once I have a disconnect, I will try to restore the session and see if it will get back or not.

But how can we distinguish if a user Logout from WhatsApp or Logged into the Whatsapp Chrome?

The error code 1000 only states that the connection to whatsapp was closed by the server. The reason for disconnecting is unknown. But in both cases, getting disconnected because someone opend a browser session or because whatsapp disconnects you for some other reason ("maybe reboot", "maybe to reload the page, to get the newest WA web version"), you should be able to restore the session with the saved tokens.
If the restore is not working, we got a serious issue...

Well, my program deletes the session when it got "ErrConnectionClosed".... which indicates there is a connection problem which not related to the session.

You already said it. The connection is closed due to a problem not related to the session. This indicates that you can reuse your session tokens to establish a new connection.

I scanned the QR and saved the session on another file. once I have a disconnect, I will try to restore the session and see if it will get back or not.

Make sure to always save the tokens after successful connecting AND successful reconnecting, because the tokens are changed after every login. The old tokens also work for a while, but they will not give you an immediate session. The API will have to solve one or multiple challenges to get logged in. Mostly the challenge will succeed, but sometimes it will fail, especially if you use a far older token and many challenges are required.

@SchulteMK thank you for the steep by.
Well, my program deletes the session when it got "ErrConnectionClosed".... which indicates there is a connection problem which not related to the session.
I scanned the QR and saved the session on another file. once I have a disconnect, I will try to restore the session and see if it will get back or not.

But how can we distinguish if a user Logout from WhatsApp or Logged into the Whatsapp Chrome?

  • Logout from WhatsApp: they will throw a 401 error indicating phone is unpaired;
  • Logged into the WhatsApp Web: they will dispatch a command disconnect with kind replaced.

@SchulteMK @rhsobr great information, well i managed to solve the problem via @SchulteMK method.
Actually l don't know that i can restore the sessions even if user open whatsapp chrome.
Which it seems to work like a charm.

Regard

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloslfu picture carloslfu  Â·  5Comments

anton-rs picture anton-rs  Â·  10Comments

jhow2892 picture jhow2892  Â·  3Comments

Leonardo-Crespo picture Leonardo-Crespo  Â·  6Comments

Valdenirmezadri picture Valdenirmezadri  Â·  5Comments