Skip to content
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

Server Returned Error 479 #690

Open
azickri opened this issue Nov 5, 2024 · 5 comments
Open

Server Returned Error 479 #690

azickri opened this issue Nov 5, 2024 · 5 comments

Comments

@azickri
Copy link

azickri commented Nov 5, 2024

When sending messages, sometimes you get the error message 'server returned error 479'

response, err := client.SendMessage(context.Background(), senderJID, protoMessage)
if err != nil {
	errorMessage := err.Error()
	if errorMessage == "the store doesn't contain a device JID" {
		errorMessage = "whatsapp-engine: " + errorMessage + ", websocket not connected"
	} else if errorMessage == "failed to get device list: failed to send usync query: websocket not connected" {
		errorMessage = "whatsapp-engine: " + errorMessage
	}

	return nil, errors.New(errorMessage)
}
@mircoianese
Copy link

I'm getting this consistently while trying to edit an ImageMessage on a newsletter

#697

@nurtai325
Copy link

did you solve it?

@nurtai325
Copy link

i am facing the same

@azickri
Copy link
Author

azickri commented Dec 14, 2024

Hello, @nurtai325 .
I usually experience this problem because the recipient number is invalid or there is a socket connection problem in the package.

The temporary solution I am currently using is to validate the recipient number including the country code. And also routinely restart the socket connection to perform a re-initiation.

However, I haven't found a definitive solution yet, so I hope this issue will be kept open if someone finds a definitive solution.

@nurtai325
Copy link

nurtai325 commented Dec 14, 2024

Hey, @azickri thanks. I found out why the problem happens in my case. I wasn't waiting for it ti actually authenticate and store the information when getting success event from the qr channel and returned from the function immidiately.
if evt.Event == "success" { return }
i added some wait time.
if evt.Event == "success" { time.Sleep(time.Second * 2) cli.Disconnect() return }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants