Wa-automate-nodejs: onMessage method does not emit messages from a fresh number (or number with chat deleted)

Created on 5 Jun 2020  Â·  8Comments  Â·  Source: open-wa/wa-automate-nodejs

Describe the bug
Messages from a fresh number (with no previous communication or with the chat deleted) do not get emitted at the onMessage method. P.S. ~I have not yet tested onAnyMessage. Will update once tested.~ ~onAnyMessage works as before.~ My bad. onAnyMessage does not work either.

Steps to Reproduce
Steps to reproduce the behavior:
You can reproduce it without any fresh number. Just remove an old chat, and try to send message from that number. You will notice the message does not get emitted at the onMessage method.

create() code
This is the code you use to create the client. e.g

{
    executablePath: "/usr/bin/google-chrome",
    headless: false,
    blockCrashLogs: true,
    restartOnCrash: true, 
    bypassCSP: true,
}

Expected behavior
A clear and concise description of what you expected to happen.

DEBUG INFO
This is the info printed to the console when you start your app. It should look like this

Debug Info {
  WA_VERSION: 2302.2,
  PAGE_UA: WhatsApp/0.4.613 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36,
  WA_AUTOMATE_VERSION: 1.9.63,
  BROWSER_VERSION: Chrome 83.0.4103.97
}

Screenshots
If applicable, add screenshots to help explain your problem. Use headless: false to get screenshots

Host (please complete the following information):

  • Android 10 + Ubuntu 16.04.3

Additional context
Add any other context about the problem here.

PRIORITY

Most helpful comment

@UnKnoWn-Consortium @roelandp @arwanfiles please try the latest version and let me know if it worked for you. Thanks

All 8 comments

On my machine, both of onMessage and onAnyMessage not work for fresh number or deleted chat.

On my machine, both of onMessage and onAnyMessage not work for fresh number or deleted chat.

My bad. onAnyMessage does not work either.

Confirming this. Just tested with one of my numbers, by deleting the conversation. Also restarting the script with fresh pairing does not fix it. I don't see any logs related to it, just won't get an "onMessage" for the incoming msg.

However, when I stop and delete "session.data.json" it will work again, so there might be a clue.

Adding to this: and indeed when then doing a completely fresh number it's not working.

Host: Debian GNU/Linux 9

When analysing on my local computer with "headless: false" to visually inspect, it seems as if fresh numbers don't appear in Web.Whatsapp, only after a full refresh I am able to see them.

@github-actions run


âš¡ Release! âš¡

(async () => {
function exec(cmd) {
  console.log(execSync(cmd).toString());
}

// Config
const gitUserEmail = "github-actions[bot]@users.noreply.github.com";
const gitUserName = "github-actions[bot]";

exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`);
exec(`git config --global user.email "${gitUserEmail}"`);
exec(`git config --global user.name "${gitUserName}"`);
exec(`npm i`);
exec(`npm run release-ci`);

//comment on the issue
var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString();

    await postComment(result);

//create changelog image
exec(`npm run release-image`);
exec(`git commit -a -m 'updated release-image'`);
exec(`git push --force`);
  })();

Changelog

🚀 Release 1.9.64 (2020-06-05)

  • build(deps): bump chrome-launcher from 0.13.2 to 0.13.3 #523
  • build(deps-dev): bump typescript from 3.9.3 to 3.9.5 #524
  • Release 1.9.64 d75b4cf
  • fix: new chats now trigger onMessage and onAnyMessage #521 ed28c09
  • fixed base64 error b13d7cd
  • removed redundant base2 9778f60

@UnKnoWn-Consortium @roelandp @arwanfiles please try the latest version and let me know if it worked for you. Thanks

@smashah I can confirm the issue is now fixed.

Was this page helpful?
0 / 5 - 0 ratings