onAnyMessage losing PTT messages sent from HOST DEVICE #1809
dudagervasio posted onGitHub
<!-- READ THIS FIRST: - Make sure you are running the latest version of @open-wa/wa-automate before reporting an issue. - Provide as many details as possible. Paste logs, configuration samples and code into the backticks. DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment. -->
Describe the bug A clear and concise description of what the bug is.
Hook "onAnyMessage" is losing some PTT messages sent from HOST DEVICE
Steps to Reproduce Steps to reproduce the behavior:
- Made a fresh install of latest version of @open-wa/wa-automate
- Client ready
- Got the HOST DEVICE (phone) in hands
- Send about 20 to 30 PTT messages for testing
- Log received events in console, with a counter
- Not all sent ptt messages generates a log
create() code This is the code you use to create the client. e.g
const wa = require('@open-wa/wa-automate');
wa.create({
headless: false,
logConsole: true,
}).then(client => start(client));
let counter = 0;
function start(client) {
client.onAnyMessage(async message => {
if(message.type === 'ptt' && message.fromMe){
counter++;
console.log(`PTT from ME n. ${counter}`);
}
});
}
Expected behavior A clear and concise description of what you expected to happen.
I expected that ALL ptt messages were captured
DEBUG INFO This is the info printed to the console when you start your app. It should look like this
Debug Info {
WA_VERSION: 2.2123.7,
PAGE_UA: WhatsApp/2.2108.8 Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36,
WA_AUTOMATE_VERSION: 4.5.1,
BROWSER_VERSION: Chrome/92.0.4512.0,
}
Screenshots
1) TEST ONE Sent 20 messages, lost 2 (10%)
Chrome Instance (headless: false) OK - All 20 ptt messages
Console Logs only 18 received events
2) TEST TWO Sent 30 ptt messages, lost 2 (6,7%)
In another test last week, as i mentioned at discord, i lost 3 of 10 messages. I also have done some tests with text messages and i had no problem.
Host (please complete the following information): OS: Windows 10, NODE: 14.17.0, NPM: 7.17.0
Additional context Add any other context about the problem here.
Sorry about my poor english :)