Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

[BUG] Receiving invalid message from events['messages.upsert']

Open satriowicaksn opened this issue 1 year ago • 2 comments

Describe the bug A clear and concise description of what the bug is. On events['messages.upsert'] I got invalid message content with structure like this :

{ "key": { "remoteJid": "[email protected]", "fromMe": false, "id": "sensored" }, "messageTimestamp": 1686622027, "pushName": "My Customer Name", "messageStubType": 2, "messageStubParameters": [ "Message absent from node" ] }

To Reproduce Steps to reproduce the behavior:

  1. Created a new connection
  2. Send message to connected number
  3. console.log() on events['messages.upsert'] value or save every events to DB

Expected behavior A clear and concise description of what you expected to happen. Message content displayed are appropriate on whatsapp (only normal text)

Environment (please complete the following information):

  • Is this on a server? yes

  • What do your connectOptions look like? const sock = makeWASocket({ version: [2,2323,4], printQRInTerminal: true, patchMessageBeforeSending: (message) => { const requiresPatch = !!( message.buttonsMessage || message.templateMessage || message.listMessage ); if (requiresPatch) { message = { viewOnceMessage: { message: { messageContextInfo: { deviceListMetadataVersion: 2, deviceListMetadata: {}, }, ...message, }, }, }; }

    return message; }, auth: state, markOnlineOnConnect: false, generateHighQualityLinkPreview: true, shouldIgnoreJid: jid => isJidStatusBroadcast(jid), defaultQueryTimeoutMs: undefined });

  • Do you have multiple clients on the same IP? no

  • Are you using a proxy? no

Additional context Add any other context about the problem here.

satriowicaksn avatar Jun 13 '23 07:06 satriowicaksn

up

satriowicaksn avatar Jun 13 '23 07:06 satriowicaksn

#oot Can you share complete source code for send message using this project?

garis-project avatar Jun 13 '23 07:06 garis-project

anyone know to solve this issue ??

satriowicaksn avatar Jul 11 '23 16:07 satriowicaksn

I am facing the same issue here. Some of the numbers initiating their messages seems to have the "Message absent from node" issue, and the text message is not available. Any pointers on how to solve such issue?

boonkahming avatar Jul 12 '23 07:07 boonkahming

I am facing the same issue here. Some of the numbers initiating their messages seems to have the "Message absent from node" issue, and the text message is not available. Any pointers on how to solve such issue?

are you guys not getting the message later? it's just failed on first decryption or else and will be retried. you'll get the message later after successful decryption or retry, in my case the longest take +- 5 seconds.

Fonnte avatar Jul 12 '23 08:07 Fonnte

I am facing the same issue here. Some of the numbers initiating their messages seems to have the "Message absent from node" issue, and the text message is not available. Any pointers on how to solve such issue?

are you guys not getting the message later? it's just failed on first decryption or else and will be retried. you'll get the message later after successful decryption or retry, in my case the longest take +- 5 seconds.

I am not getting any message later, and also not getting any retries. The sender sent the second message and still get the similar "Message absent from node" issue.

But after asking the sender to add our number as contact, the third message is able to be retrieved. However, it would be impossible to ask all our users to add our number as contact. How do you manage to retrieve the decrypted message?

boonkahming avatar Jul 12 '23 09:07 boonkahming

I am facing the same issue here. Some of the numbers initiating their messages seems to have the "Message absent from node" issue, and the text message is not available. Any pointers on how to solve such issue?

are you guys not getting the message later? it's just failed on first decryption or else and will be retried. you'll get the message later after successful decryption or retry, in my case the longest take +- 5 seconds.

I am not getting any message later, and also not getting any retries. The sender sent the second message and still get the similar "Message absent from node" issue.

But after asking the sender to add our number as contact, the third message is able to be retrieved. However, it would be impossible to ask all our users to add our number as contact. How do you manage to retrieve the decrypted message?

are you messing with auth keys? are you using useMultiFileAuthState or custom storage? i don't do any fancy code, but the incoming message will be retried and available some time later,

Screenshot_133

this happen few minutes ago and i have it few seconds later.

Fonnte avatar Jul 12 '23 09:07 Fonnte

I am facing the same issue here. Some of the numbers initiating their messages seems to have the "Message absent from node" issue, and the text message is not available. Any pointers on how to solve such issue?

are you guys not getting the message later? it's just failed on first decryption or else and will be retried. you'll get the message later after successful decryption or retry, in my case the longest take +- 5 seconds.

I am not getting any message later, and also not getting any retries. The sender sent the second message and still get the similar "Message absent from node" issue. But after asking the sender to add our number as contact, the third message is able to be retrieved. However, it would be impossible to ask all our users to add our number as contact. How do you manage to retrieve the decrypted message?

are you messing with auth keys? are you using useMultiFileAuthState or custom storage? i don't do any fancy code, but the incoming message will be retried and available some time later,

Screenshot_133

this happen few minutes ago and i have it few seconds later.

I run the Baileys node with the --no-store option because the store writing is taking up much server resources and eventually slows down the server. Do I need to enable store in order for the retry to work?

boonkahming avatar Jul 12 '23 09:07 boonkahming

Message absent from node, most probably a bug from WA itself, especially when it comes to adreply (advertising link from FB) message.

Just to clarify, you can compare the actual message that appears on our device but not on web WA. When this happens, Bailey will not be able to decrypt the message since it is already broken within web WA itself.

The situation is completely different when sending a message through baileys. We have a function to retry and resend the failed message.

azudindaem avatar Jul 13 '23 06:07 azudindaem

Message absent from node, most probably a bug from WA itself, especially when it comes to adreply (advertising link from FB) message.

Just to clarify, you can compare the actual message that appears on our device but not on web WA. When this happens, Bailey will not be able to decrypt the message since it is already broken within web WA itself.

The situation is completely different when sending a message through baileys. We have a function to retry and resend the failed message.

@azudindaem Just to confirm, can I say that for now this issue is still an unknown, and there is no way for us to retrieve the actual message in Baileys when we get the "Message absent from node" response, correct?

boonkahming avatar Jul 22 '23 06:07 boonkahming

UP

paulohsilvestre avatar Jul 31 '23 16:07 paulohsilvestre

I have the same issue I think is because some setting like this image

leifermendez avatar Aug 12 '23 19:08 leifermendez

I have the same issue I think is because some setting like this image

It is correct this message is generated when there is a time update of messages that disappear I share with you one of these update messages, therefore you should keep this update on the chat in mind to avoid having this inconvenience

image

andresayac avatar Aug 13 '23 21:08 andresayac

guys, disappearing message aren't the same issue – they aren't even an issue.

azudindaem avatar Aug 13 '23 23:08 azudindaem

up

Anuudek avatar Sep 05 '23 15:09 Anuudek

up

asdasdad123be avatar Sep 15 '23 23:09 asdasdad123be

up

jaison-x avatar Nov 23 '23 13:11 jaison-x

Investigating, been noticing this more and more

EDIT 1: It seems the message retry system itself is failing

purpshell avatar Nov 25 '23 20:11 purpshell

I am getting this for new chats too. It seems random. The retry system sometimes works and sometimes not.

jaison-x avatar Nov 25 '23 21:11 jaison-x

I don't know if it's the same problem but here the ev['messages.upsert'] out of nowhere stops working and sometimes even restarting the application it still doesn't receive the messages only after restarting several times it works fine again, but it's a bug that has happened frequently

tiagomatrixd avatar Nov 25 '23 23:11 tiagomatrixd

I don't know if it's the same problem but here the ev['messages.upsert'] out of nowhere stops working and sometimes even restarting the application it still doesn't receive the messages only after restarting several times it works fine again, but it's a bug that has happened frequently

Out of topic, you need to restart frequently

purpshell avatar Dec 04 '23 15:12 purpshell

I am getting this for new chats too. It seems random. The retry system sometimes works and sometimes not.

Same thing here. i am working on a proper fix for the retry system so I am getting a few logs from some clients who have this issue. We'll work on this and get it just as pristine as the official whatsapp web app

purpshell avatar Dec 04 '23 15:12 purpshell

Também estou recebendo isso para novos bate-papos. Parece aleatório. O sistema de nova tentativa às vezes funciona e às vezes não.

Mesma coisa aqui. estou trabalhando em uma correção adequada para o sistema de nova tentativa, por isso estou recebendo alguns registros de alguns clientes que têm esse problema. Trabalharemos nisso e o deixaremos tão puro quanto o aplicativo web oficial do Whatsapp

Hello friend @PurpShell .Did you get any solution on this, I'm having a lot of problems with some customers

ericdesaoficial avatar Dec 08 '23 14:12 ericdesaoficial

Has anyone got progress on this?

jaison-x avatar Dec 14 '23 18:12 jaison-x

Solution found, fixing.

EDIT: NEW PR OUT #554

purpshell avatar Dec 18 '23 14:12 purpshell

Message absent from node, most probably a bug from WA itself, especially when it comes to adreply (advertising link from FB) message.

Just to clarify, you can compare the actual message that appears on our device but not on web WA. When this happens, Bailey will not be able to decrypt the message since it is already broken within web WA itself.

The situation is completely different when sending a message through baileys. We have a function to retry and resend the failed message.

Does this means if first we were getting a message absent from node, baileys will retry to decrypt again and send another upsert event when it was successful?

kyraex avatar Dec 19 '23 05:12 kyraex

after testing on active fbads there are still appear

 {
		"messages": [
			{
				"key": {
					"remoteJid": "[email protected]",
					"fromMe": false,
					"id": "C667337FC2A7xxxx"
				},
				"messageTimestamp": 1703033961,
				"pushName": "xxx",
				"broadcast": false,
				"messageStubType": 2,
				"messageStubParameters": [
					"Message absent from node"
				]
			}
		],
		"type": "notify",
		"jid": "[email protected]",
		"hasNewMessage": true
	}

azudindaem avatar Dec 20 '23 03:12 azudindaem

Message absent from node, most probably a bug from WA itself, especially when it comes to adreply (advertising link from FB) message. Just to clarify, you can compare the actual message that appears on our device but not on web WA. When this happens, Bailey will not be able to decrypt the message since it is already broken within web WA itself. The situation is completely different when sending a message through baileys. We have a function to retry and resend the failed message.

Does this means if first we were getting a message absent from node, baileys will retry to decrypt again and send another upsert event when it was successful?

It will send a message.update! @azudindaem as well, this is expected. What happened before was that we couldn't parse the response, we were sending a retry but not parsing the response. After parsing, messages.update gives you the new message. Handle it there

purpshell avatar Dec 23 '23 03:12 purpshell

Message absent from node, most probably a bug from WA itself, especially when it comes to adreply (advertising link from FB) message. Just to clarify, you can compare the actual message that appears on our device but not on web WA. When this happens, Bailey will not be able to decrypt the message since it is already broken within web WA itself. The situation is completely different when sending a message through baileys. We have a function to retry and resend the failed message.

Does this means if first we were getting a message absent from node, baileys will retry to decrypt again and send another upsert event when it was successful?

It will send a message.update! @azudindaem as well, this is expected. What happened before was that we couldn't parse the response, we were sending a retry but not parsing the response. After parsing, messages.update gives you the new message. Handle it there

It works very nice, thanks you @PurpShell 2023-12-26_10h41_31

Zedmerlol avatar Dec 26 '23 13:12 Zedmerlol

When a new version with this PR is release?

clairton avatar Dec 27 '23 18:12 clairton