You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i used LocalAuth as client initialize, after i scan the qr, and wait for a few minute, the client is destroy.
i tried to add change_state and the state said OPENING, after a few seconds, it throws an error said
Evaluation failed: TypeError: Cannot read properties of undefined (reading 'shiftTimer')
at pptr://puppeteer_evaluation_script:2:49
i expected it can reset the client state back to online rather than throw an error caused by shiftTimer
Steps to Reproduce the Bug or Issue
use LocalAuth for authentication
add change_state event in client
wait for a few minutes
the client is destroyed
Relevant Code
client.on('change_state', async (_state) => {
let state = _state
try{
const number = client.info.wid.user
console.log(`Client ${number} state : ${state}`)
/**
* Once the internet connection is lost the client state will be set to WAState.OPENING.
* The resetState function immediately changes the client state to WAState.CONNECTED
* after internet reconnection.
*/
while (state === WAState.OPENING || state === WAState.TIMEOUT || state === WAState.UNPAIRED) {
await client.resetState();
/**
* It is recommended to add a delay after each iteration at least 1000 msec
* to prevent useless frequent function calls and unexpected behavior.
*/
await delay(3000);
}
console.log(`Client ${number} state : ${state} after change`)
}catch(e){
console.log(e.message)
}
});
Browser Type
Google Chrome
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: Linux (Ubuntu : 20.04.6)
Phone : IOS
Whatsapp-web.js version : 1.25.0
Node.js version : 20.11.0
Additional context
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Describe the bug
i used LocalAuth as client initialize, after i scan the qr, and wait for a few minute, the client is destroy.
i tried to add change_state and the state said OPENING, after a few seconds, it throws an error said
Evaluation failed: TypeError: Cannot read properties of undefined (reading 'shiftTimer')
at pptr://puppeteer_evaluation_script:2:49
i used this solution #2283 but it's not working.
Expected behavior
i expected it can reset the client state back to online rather than throw an error caused by shiftTimer
Steps to Reproduce the Bug or Issue
Relevant Code
Browser Type
Google Chrome
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: Linux (Ubuntu : 20.04.6)
Phone : IOS
Whatsapp-web.js version : 1.25.0
Node.js version : 20.11.0
Additional context
No response
The text was updated successfully, but these errors were encountered: