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][NOWEB] message.any arriving as null #813

Closed
TitoBahe opened this issue Feb 17, 2025 · 15 comments
Closed

[BUG][NOWEB] message.any arriving as null #813

TitoBahe opened this issue Feb 17, 2025 · 15 comments
Labels
bug Something isn't working patron:PRO

Comments

@TitoBahe
Copy link

TitoBahe commented Feb 17, 2025

Discussed in #812

Originally posted by TitoBahe February 17, 2025

So, some msgs are arriving with no body and no attachments.

I dont know how to reproduce this bug and why they're arriving like that. Idk if you remember but I reported an error with temporary msgs arriving empty. Its the same problem but its becoming more frequent.

They are, generally, normal msgs, but they arrive without a body or media for some reason. Its not always, but frequently enough to piss off all of my costumers. All of them are Brazilian numbers.

For Instance, today it happend 6 consecutively times for the same number, here two of the message.any event I got from them:

MESSAGE.ANY:  {
   id: 'evt_01jmadgp3n2g9an269rqw2ycvk',
   event: 'message.any',
   session: 'xqBFeOe8aUuZI8tfnSDv-clientId0',
   metadata: {
     'user.id': 'xqBFeOe8aUuZI8tfnSDv-clientId0',
     'user.email': 'email@example.com'
   },
   me: { id: 'xxxxxxxxxx@c.us', pushName: 'Full Funnel' },
   payload: {
     id: 'false_yyyyyyyy@c.us_3F24595D42761017BE1E',
     timestamp: 1739811477,
     from: 'yyyyyyyy@c.us',
     fromMe: false,
     hasMedia: false,
     media: null,
     ack: null,
     ackName: 'UNKNOWN',
     replyTo: null,
     _data: {
       key: [Object],
       messageTimestamp: 1739811477,
       pushName: 'Rodrigo',
       broadcast: false,
       message: [Object],
       verifiedBizName: 'Rodrigo xxxx'
     }
   },
   engine: 'NOWEB',
   environment: {
     version: '2025.2.4',
     engine: 'NOWEB',
     tier: 'PLUS',
     browser: '/usr/bin/chromium'
   }
 }
MESSAGE.ANY:  {
  id: 'evt_01jmadg6n5att2z1enncjx774b',
  event: 'message.any',
  session: 'xqBFeOe8aUuZI8tfnSDv-clientId0',
  metadata: {
    'user.id': 'xqBFeOe8aUuZI8tfnSDv-clientId0',
    'user.email': 'email@example.com'
  },
  me: { id: 'xxxxxxxxx@c.us', pushName: 'Full Funnel' },
  payload: {
    id: 'false_yyyyyyy@c.us_3F1C6C02FFA5568DE0C9',
    timestamp: 1739811461,
    from: 'yyyyyyyy@c.us',
    fromMe: false,
    hasMedia: false,
    media: null,
    ack: null,
    ackName: 'UNKNOWN',
    replyTo: null,
    _data: {
      key: [Object],
      messageTimestamp: 1739811461,
      pushName: 'Rodrigo',
      broadcast: false,
      message: [Object],
      verifiedBizName: 'Rodrigo xxxx'
    }
  },
  engine: 'NOWEB',
  environment: {
    version: '2025.2.4',
    engine: 'NOWEB',
    tier: 'PLUS',
    browser: '/usr/bin/chromium'
  }
}

error

And the actual msgs sent:

WhatsApp Image 2025-02-17 at 20 15 52

So you can see they are normal text msgs with no attchments or buttons, polls, or anything like that, just text msgs.

**EDIT: He actually just sent us two more messages—one with an attachment and a body, and another with no attachment, just text, which also arrived as null like the others above. What's strange is that the one with the attachment was received correctly:

MESSAGE.ANY:  {
   id: 'evt_01jmamh33jwqdsehk38a1f6s9p',
   event: 'message.any',
   session: 'xqBFeOe8aUuZI8tfnSDv-clientId0',
   metadata: {
     'user.id': 'xqBFeOe8aUuZI8tfnSDv-clientId0',
     'user.email': 'email@example.com'
   },
   me: { id: 'xxxxxxxx@c.us', pushName: 'Full Funnel' },
   payload: {
     id: 'false_yyyyyyy@c.us_3F26D7D7D57546E26341',
     timestamp: 1739818830,
     from: 'yyyyyyyyy@c.us',
     fromMe: false,
     body: 'Como tira a borda branca de um formulário do fullfunnel embedado no wordpress?',
     hasMedia: true,
     media: {
       url: 'http://localhost:3000/api/files/xqBFeOe8aUuZI8tfnSDv-clientId0/3F26D7D7D57546E26341.jpeg',
       filename: null,
       mimetype: 'image/jpeg'
     },
     mediaUrl: 'http://localhost:3000/api/files/xqBFeOe8aUuZI8tfnSDv-clientId0/3F26D7D7D57546E26341.jpeg',
     ack: null,
     ackName: 'UNKNOWN',
     replyTo: null,
     _data: {
       key: [Object],
       messageTimestamp: 1739818830,
       pushName: 'Rodrigo',
       broadcast: false,
       message: [Object],
       verifiedBizName: 'Rodrigo xxxxx',
       media: [Object]
     }
   },
   engine: 'NOWEB',
   environment: {
     version: '2025.2.4',
     engine: 'NOWEB',
     tier: 'PLUS',
     browser: '/usr/bin/chromium'
   }
 }

We had a user with 15 conections, he had so many msgs arriving null that he decided to quit my plataform, so, basicly I lost a costumer today. So, please, take a deep look at it. I am really needing this help from you guys, more than never.
I can help to solve this problem, just tell me where to look into.

patron:PRO

@devlikepro
Copy link
Contributor

devlikepro commented Feb 18, 2025

Hi! Could you provide message: [Object] , what is in it? I believe it must have some data - it'd help us understand the issue

patron:PRO

@devlikepro devlikepro added the bug Something isn't working label Feb 18, 2025
@devlikepro devlikepro changed the title message.any arriving as null [BUG][NOWEB] message.any arriving as null Feb 18, 2025
@devlikepro
Copy link
Contributor

devlikepro commented Feb 18, 2025

Tested it with WA Business, Regular, all types of messages - nothing :( Waiting for some info inside message - that would help us a lot!

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

I just got this null msg, in this case, its triggered right after sending a new msg to a Temporary conversation. So if the conversation is set to temporary, I receive this message.any event every time I send a new msg to the other person.

MESSAGE.ANY:  {
   id: 'evt_01jmcaazghjc9d9zgn296qfjz3',
   event: 'message.any',
   session: 'eQdlkmzpLsor2np1qYOE-clientId9',
   metadata: {
     'user.id': 'eQdlkmzpLsor2np1qYOE-clientId9',
     'user.email': 'email@example.com'
   },
   me: { id: 'xxxxxx@c.us', pushName: 'SUPORTE Prof Carlos André' },
   payload: {
     id: 'false_yyyyyyu@c.us_CCC46344B2E95019AB29F8852F9D01F6',
     timestamp: 1739875253,
     from: 'yyyyyy@c.us',
     fromMe: false,
     hasMedia: false,
     media: null,
     ack: null,
     ackName: 'UNKNOWN',
     replyTo: null,
     _data: {
       key: [Object],
       messageTimestamp: 1739875253,
       pushName: 'Cintia Rocha',
       broadcast: false,
       message: [Object]
     }
   },
   engine: 'NOWEB',
   environment: {
     version: '2025.2.4',
     engine: 'NOWEB',
     tier: 'PLUS',
     browser: '/usr/bin/chromium'
   }
 }

This is the Message Object:

 Message:  {
   protocolMessage: {
     key: { remoteJid: 'xxxxxx@s.whatsapp.net', fromMe: true },
     type: 'EPHEMERAL_SYNC_RESPONSE',
     ephemeralExpiration: 7776000,
     ephemeralSettingTimestamp: '1738352',
     disappearingMode: {
       initiator: 'INITIATED_BY_OTHER',
       trigger: 'ACCOUNT_SETTING',
       initiatedByMe: false
     }
   },
   messageContextInfo: {
     deviceListMetadata: {
       recipientKeyHash: 'mZmFkr8OyfGfUA==',
       recipientTimestamp: '1739389681'
     },
     deviceListMetadataVersion: 2
   }
 }

I have to find another normal text null message. They happen randomly, but for sure they will happen again. I am sorry for replying so late, I belive, we live in different time zones.

patron:PRO

@devlikepro
Copy link
Contributor

devlikepro commented Feb 18, 2025

Ok, we'll filter out protocolMessage from message.any! I guess people use it only for body/media (we do)

May be we'll create message.all for those who still wants receiving it 😆 too many message...

patron:PRO

@devlikepro
Copy link
Contributor

devlikepro commented Feb 18, 2025

For now as quick fix - you can filter ignore the message if it has _data.message.protocolMessage field (and no body/media, but from we've seen protocolMessage comes only with that field, but just in case)

patron:PRO

@devlikepro
Copy link
Contributor

devlikepro commented Feb 18, 2025

I have to find another normal text null message.

Yes please! 🙏

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

Yes please! 🙏

Okay, I will send you later, as fast as fast as possible

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

I just got one normal msgs null:

 MESSAGE.ANY:  {
   id: 'evt_01jmccvjeshdcf9rvqew6wp591',
   event: 'message.any',
   session: 'eQdlkmzpLsor2np1qYOE-clientId7',
   metadata: {
     'user.id': 'eQdlkmzpLsor2np1qYOE-clientId7',
     'user.email': 'email@example.com'
   },
   me: { id: 'yyyyyyyyy@c.us', pushName: 'SUPORTE Prof Carlos André' },
   payload: {
     id: 'false_xxxxxxxxx@c.us_3FB8737201E7B76595B1',
     timestamp: 1739877894,
     from: 'xxxxxxxx@c.us',
     fromMe: false,
     hasMedia: false,
     media: null,
     ack: null,
     ackName: 'UNKNOWN',
     replyTo: null,
     _data: {
       key: [Object],
       messageTimestamp: 1739877894,
       pushName: 'Natan Oliveira',
       broadcast: false,
       message: [Object]
     }
   },
   engine: 'NOWEB',
   environment: {
     version: '2025.2.4',
     engine: 'NOWEB',
     tier: 'PLUS',
     browser: '/usr/bin/chromium'
   }
 }
 Message:  {
   messageContextInfo: {
     deviceListMetadata: {
       senderKeyHash: '72/7nm9J3q9Dqg==',
       senderTimestamp: '1739304202',
       recipientKeyHash: 'shNo1C/+1KsUmA==',
       recipientTimestamp: '1739323093'
     },
     deviceListMetadataVersion: 2
   },
   ephemeralMessage: { message: { extendedTextMessage: [Object] } }
 }

I will extend that ephemeral message object to look deeper into it.

patron:PRO

@devlikepro
Copy link
Contributor

devlikepro commented Feb 18, 2025

oh, I see, will handle it tomorrow and publish release with the fix!

I will extend that ephemeral message

Yes pls🙏

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

oh, I see, will handle it tomorrow and publish release with the fix!

I will extend that ephemeral message

Yes pls🙏

patron:PRO

Did you guys already find out what was happening? I am still waiting for another null msg to appear to send you the data. And thanks for the help!! Seriously, best support I've ever had from a open source community in my entire life!

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

Edited messages are coming null as well and with protocolMessage object, If you stop those new null body and attachments msgs with protocolMessage from showing up, edited msgs will no longer appear as well. The protocolMessage has type MESSAGE_EDIT for edited msgs.

MESSAGE.ANY:  {
  id: 'evt_01jmcg4mycbyk6p1m4sadjer0x',
  event: 'message.any',
  session: 'eQdlkmzpLsor2np1qYOE-clientId4',
  metadata: {
    'user.id': 'eQdlkmzpLsor2np1qYOE-clientId4',
    'user.email': 'email@example.com'
  },
  me: { id: 'yyyyyyyy@c.us', pushName: 'SUPORTE Prof CA' },
  payload: {
    id: 'false_xxxxxxxxx@c.us_4C3FDE3C4CAE148ED02CE93DF0B26748',
    timestamp: 1739881337,
    from: 'xxxxxxxx@c.us',
    fromMe: false,
    hasMedia: false,
    media: null,
    ack: null,
    ackName: 'UNKNOWN',
    replyTo: null,
    _data: {
      key: [Object],
      messageTimestamp: 1739881337,
      pushName: 'Sylvanneth',
      broadcast: false,
      message: [Object]
    }
  },
  engine: 'NOWEB',
  environment: {
    version: '2025.2.4',
    engine: 'NOWEB',
    tier: 'PLUS',
    browser: '/usr/bin/chromium'
  }
}
 Message:  {
   protocolMessage: {
     key: {
       remoteJid: 'yyyyyyy@s.whatsapp.net',
       fromMe: true,
       id: 'E765D4E8227AEB094FAE875D5A1417AD'
     },
     type: 'MESSAGE_EDIT',
     editedMessage: {
       conversation: 'Bom dia! Eu segui todas as orientações constantes no email que vocês enviaram.\n' +
         'O direcionamento foi para o site, conforme tela que enviei abaixo.'
     },
     timestampMs: '1739881337506'
   },
   messageContextInfo: {
     deviceListMetadata: {
       senderKeyHash: 'zIo8qs8MxTd8Qw==',
       senderTimestamp: '1739748881',
       recipientKeyHash: 'BaQNr7mkyuh18A==',
       recipientTimestamp: '1739363050'
     },
     deviceListMetadataVersion: 2,
     messageSecret: 'kD4Ce8OCd6FbUfPIy/kd/fErOij7e6eaEArLmuuMMqs='
   }
 }

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

Finnally I got a null text msg again:

 MESSAGE.ANY:  {
   id: 'evt_01jmch17pdpkjrp1hvpsj454x4',
   event: 'message.any',
   session: 'xqBFeOe8aUuZI8tfnSDv-clientId0',
   metadata: {
     'user.id': 'xqBFeOe8aUuZI8tfnSDv-clientId0',
     'user.email': 'email@example.com'
   },
   me: { id: 'xxxxxxxxx@c.us', pushName: 'Full Funnel' },
   payload: {
     id: 'false_yyyyyyy@c.us_3FCA366D2F3C37B18F62',
     timestamp: 1739882274,
     from: 'yyyyyyyy@c.us',
     fromMe: false,
     hasMedia: false,
     media: null,
     ack: null,
     ackName: 'UNKNOWN',
     replyTo: null,
     _data: {
       key: [Object],
       messageTimestamp: 1739882274,
       pushName: 'Rodrigo',
       broadcast: false,
       message: [Object],
       verifiedBizName: 'Rodrigo Juliani'
     }
   },
   engine: 'NOWEB',
   environment: {
     version: '2025.2.4',
     engine: 'NOWEB',
     tier: 'PLUS',
     browser: '/usr/bin/chromium'
   }
 }
 Message:  {
   messageContextInfo: {
     deviceListMetadata: {
       senderKeyHash: 'TFeF38l92Mrweg==',
       senderTimestamp: '1738969423',
       recipientKeyHash: 'K0u76kvcoh+64Q==',
       recipientTimestamp: '1739400485'
     },
     deviceListMetadataVersion: 2
   },
   ephemeralMessage: { message: { extendedTextMessage: [Object] } }
 }
 ephemeralMessage message: {
   extendedTextMessage: {
     text: 'De deixar o mesmo email de projetos como dono das duas contas?',
     contextInfo: {
       expiration: 7776000,
       ephemeralSettingTimestamp: '1738155928',
       disappearingMode: [Object]
     }
   }

The msg appears on ephemeralMessage.message, but the name of the object inside of it appears to vary between conversation, extendedTextMessage and message. And for some reason, attachments are working perfectly normal even for temporary conversations.

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 18, 2025

The protocolMessage types I saw until now were, all of them arrive as no body and no attachmnets msg:

EPHEMERAL_SYNC_RESPONSE -> when you send a msg into a temporary conversation

EPHEMERAL_SETTING -> when you set the conversation to temporary, whatsapp shows a light grey msg telling that the conversation was set to temporary mode.

REVOKE -> when somebody deletes a msg, not necessarily on temporary mode.

MESSAGE_EDIT -> when somebody edits a msg, not necessarily on temporary mode.

And I just got a new msg with no body and no attachment:

MESSAGE.ANY:  {
 id: 'evt_01jmd6y4nka1yvnb5zwejx0yhp',
 event: 'message.any',
 session: 'xqBFeOe8aUuZI8tfnSDv-clientId0',
 metadata: {
   'user.id': 'xqBFeOe8aUuZI8tfnSDv-clientId0',
   'user.email': 'email@example.com'
 },
 me: { id: 'xxxxxxx@c.us', pushName: 'Full Funnel' },
 payload: {
   id: 'false_yyyyyyy@c.us_4CED338AE4DC96E6DD',
   timestamp: 1739905241,
   from: 'yyyyyyy@c.us',
   fromMe: false,
   hasMedia: false,
   media: null,
   ack: null,
   ackName: 'UNKNOWN',
   replyTo: null,
   _data: {
     key: [Object],
     messageTimestamp: 1739905241,
     pushName: 'yyyyyyyy',
     broadcast: false,
     message: [Object],
     verifiedBizName: 'Exact Sales'
   }
 },
 engine: 'NOWEB',
 environment: {
   version: '2025.2.4',
   engine: 'NOWEB',
   tier: 'PLUS',
   browser: '/usr/bin/chromium'
 }
}
🟡 payload._data.message:  {
 templateMessage: {
   hydratedTemplate: {
     hydratedContentText: '🔔 *Última chance de participar mentoria com Theo!* ☕\r\n' +
       '\r\n' +
       'Ainda dá tempo de se inscrever e impulsionar suas vendas no primeiro quarter com estratégias inovadoras!\r\n' +
       '\r\n' +
       '📌 *Por que você não pode perder?*\r\n' +
       '✔️ Conheça o cenário de vendas para 2025;\r\n' +
       '✔️ Descubra táticas para bater supermetas;\r\n' +
       '✔️ Aprenda a estruturar ferramentas e processos para crescer de forma sustentável.\r\n' +
       '\r\n' +
       '📅 *Quando?:*  _20/01_\r\n' +
       '⏰ *Horário:*  _16h30_\r\n' +
       '📍 *Onde?*  _ Google Meet_\r\n' +
       '\r\n' +
       '🚨 *Garanta sua vaga agora mesmo!*',
     hydratedButtons: [Array],
     templateId: '619704957444504'
   },
   templateId: '619704957444504'
 },
 messageContextInfo: {
   deviceListMetadata: {
     recipientKeyHash: 'K0u76kvcoh+64Q==',
     recipientTimestamp: '1739400485'
   },
   deviceListMetadataVersion: 2
 }
}

In this case is a button, but there are other templates.

patron:PRO

devlikepro added a commit that referenced this issue Feb 19, 2025
@devlikepro
Copy link
Contributor

devlikepro commented Feb 19, 2025

Hi! In 2025.2.5:

patron:PRO

@TitoBahe
Copy link
Author

TitoBahe commented Feb 19, 2025

Hi! In 2025.2.5:

patron:PRO

Thanks so much!!!

patron:PRO

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

No branches or pull requests

2 participants