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

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

Closed
satriowicaksn opened this issue Jun 13, 2023 · 30 comments · Fixed by #554
Closed

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

satriowicaksn opened this issue Jun 13, 2023 · 30 comments · Fixed by #554
Assignees
Labels
bug Something isn't working

Comments

@satriowicaksn
Copy link

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 satriowicaksn added the bug Something isn't working label Jun 13, 2023
@satriowicaksn
Copy link
Author

up

@garis-project
Copy link

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

@satriowicaksn
Copy link
Author

anyone know to solve this issue ??

@boonkahming
Copy link

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?

@Fonnte
Copy link

Fonnte commented Jul 12, 2023

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.

@boonkahming
Copy link

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?

@Fonnte
Copy link

Fonnte commented Jul 12, 2023

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.

@boonkahming
Copy link

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?

@azudindaem
Copy link
Contributor

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.

@boonkahming
Copy link

boonkahming commented Jul 22, 2023

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?

@paulohsilvestre
Copy link

UP

@leifermendez
Copy link

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

@andresayac
Copy link
Contributor

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

@azudindaem
Copy link
Contributor

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

@Anuudek
Copy link

Anuudek commented Sep 5, 2023

up

2 similar comments
@asdasdad123be
Copy link

up

@jaison-x
Copy link

up

@PurpShell
Copy link
Collaborator

PurpShell commented Nov 25, 2023

Investigating, been noticing this more and more

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

@jaison-x
Copy link

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

@tiagomatrixd
Copy link

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

@PurpShell PurpShell self-assigned this Dec 4, 2023
@PurpShell
Copy link
Collaborator

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
Copy link
Collaborator

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

@ericdesaoficial
Copy link

ericdesaoficial commented Dec 8, 2023

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

@jaison-x
Copy link

Has anyone got progress on this?

@PurpShell
Copy link
Collaborator

PurpShell commented Dec 18, 2023

Solution found, fixing.

EDIT: NEW PR OUT #554

@kyraex
Copy link
Contributor

kyraex commented Dec 19, 2023

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?

@azudindaem
Copy link
Contributor

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
	}

@PurpShell
Copy link
Collaborator

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

@Zedmerlol
Copy link

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

@clairton
Copy link

When a new version with this PR is release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.