Wa-automate-nodejs: Config qrTimeout authTimeout not expected

Created on 5 Nov 2020  Â·  4Comments  Â·  Source: open-wa/wa-automate-nodejs

Describe the bug
qrTimeout and authTimeout doesn't work. When try to set them its seem ignore it,

Then I try direct change code on controller/initializer.js from 60 to 20 it work what I expect.

Steps to Reproduce
Steps to reproduce the behavior:

  • config with custom qrTimeout and authTimeout
  • create client from those config

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

const config = {
  executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
  qrTimeout: 10,
  authTimeout: 10,
  headless: false,
  qrQuality: 1.0,
  skipSessionSave: true,
  blockAssets: true,
};

async function startClient(sessionId, sessionData) {
  try {
    const client = await create({...config, sessionId, sessionData });
    return client
  } catch (error) {
    Promise.reject(error)
  }
}

startClient(sessionId, account.nick_name);

Expected behavior
should throw timeout when set custome qrTimeout or authTimeout

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.2043.21'
  PAGE_UA: 'WhatsApp/2.2037.6 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36',
  WA_AUTOMATE_VERSION: '3.0.12,
  BROWSER_VERSION: 'Chrome/86.0.4240.183'
}

Screenshots
-No

Host (please complete the following information):

  • OS: OSX 10.15.7

Additional context
-No

Most helpful comment

@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`);
  })();

All 4 comments

Screen Shot 2020-11-05 at 08 18 16

please consider this logic, if we set value it will ignore that value right?
on src/controllers/initializer.ts line 144 and 165
Logic

@smashah we should change condition from && to ||

@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 3.0.13 (2020-11-05)

  • build(deps-dev): bump marked from 1.2.2 to 1.2.3 #1036
  • Release 3.0.13 a823e05
  • Check if page and browser are not nullish before attempting kill e2d67f0
  • fix: qrTimeout and authTimeout had no effect #1030 #1032 6943487
  • fix: #1037 d69f061

@arisros should be working as expected in latest version thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alishahlakhani picture alishahlakhani  Â·  4Comments

DeLuca92 picture DeLuca92  Â·  5Comments

mrbarnk picture mrbarnk  Â·  5Comments

bubaew95 picture bubaew95  Â·  6Comments

sandro-salles picture sandro-salles  Â·  4Comments