Open sword-fish333 opened 3 weeks ago
Hi, it seems WA recent update breaks session health checking. Previous versions 4.71.11 and 4.71.10 are affected too.
- Checking session integrity
info: Checking session integrity {"data":"Checking session integrity","eventName":"STARTUP.session","eventNamespace":"STARTUP","sessionId":"session","timestamp":"2024-06-11T12:08:32.362Z"}
- Session integrity check passed
info: Session integrity check passed {"data":"Session integrity check passed","eventName":"STARTUP.session","eventNamespace":"STARTUP","sessionId":"session","timestamp":"2024-06-11T12:08:32.366Z"}
info: GET SCRIPT: launch.js 71128 {"timestamp":"2024-06-11T12:08:32.367Z"}
info: Injection Result of launch.js: undefined {"timestamp":"2024-06-11T12:08:33.233Z"}
- Launch inject: 866ms
info: Launch inject: 866ms {"data":"Launch inject: 866ms","eventName":"STARTUP.session","eventNamespace":"STARTUP","sessionId":"session","timestamp":"2024-06-11T12:08:33.233Z"}
- WAPI Reinjected
info: WAPI Reinjected {"data":"WAPI Reinjected","eventName":"STARTUP.session","eventNamespace":"STARTUP","sessionId":"session","timestamp":"2024-06-11T12:08:33.233Z"}
- Checking if session is valid
info: Checking if session is valid {"data":"Checking if session is valid","eventName":"STARTUP.session","eventNamespace":"STARTUP","sessionId":"session","timestamp":"2024-06-11T12:08:33.233Z"}
error: Valid session check failed Waiting failed: 9000ms exceeded {"name":"TimeoutError","stack":"TimeoutError: Waiting failed: 9000ms exceeded\n at Timeout.<anonymous> (/home/codewa/.codewa/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:71:32)\n at listOnTimeout (node:inte...[TRUNCATED]...","timestamp":"2024-06-11T12:08:42.234Z"}
info: Store keys {"0":"Call","1":"MediaCollection","10":"WapQuery","11":"UserConstructor","12":"SendTextMsgToChat","13":"ReadSeen","14":"sendDelete","15":"addAndSendMsgToChat","16":"Catalog","17":"MsgKey","18":"Parser","19":"Builders","2":"Archive","20":"Me","21":"MyStatus","22":"ChatStates","23":"GroupActions","24":"Participants","25":"WidFactory","26":"Sticker","27":"UploadUtils","3":"Block","4":"ChatUtil","5":"GroupInvite","6":"Wap","7":"State","8":"_Presence","9":"WapDelete","timestamp":"2024-06-11T12:08:42.236Z"}
- The session is invalid. Retrying
info: The session is invalid. Retrying {"data":"The session is invalid. Retrying","eventName":"STARTUP.session","eventNamespace":"STARTUP","sessionId":"session","timestamp":"2024-06-11T12:08:42.237Z"}
π ~ needsToScan ~ elementResult: undefined
Debug info:
Debug info: {
"WA_VERSION": "2.3000.1014111620",
"PAGE_UA": "WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
"WA_AUTOMATE_VERSION": "4.71.12",
"BROWSER_VERSION": "HeadlessChrome/112.0.5614.0",
"OS": "Linux 6.5",
"START_TS": 1718107723628,
"RAM_INFO": "Total: 8.13 GB | Free: 5.61 GB",
"PPTR_VERSION": "19.11.1"
}
I tried several versions up to 4.71.4 and 4.68.0, the problem continues
yes, i could not find a solution to the problem, is on backburner in my case.
thanks for reporting this. fix coming soon, it will require updating
@github-actions run
Thank you @smashah, it's working now.
Working now Thanks
Are you using the latest version of the library?
What type of session are you experiencing this issue on?
Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag
What type of host account are you experiencing this issue on?
Personal account (normal)
Mode
EASY API/CLI
Current Behavior
when client.healthCheck().then(... is run an exception is thrown. Error during health check evaluation: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'length') at window.. (pptr://puppeteer_evaluation_script:1:361038)
at pptr://puppeteer_evaluation_script:6:28
.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:258
throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails));
^
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'length') at window.. (pptr://puppeteer_evaluation_script:1:361038)
at pptr://puppeteer_evaluation_script:6:28
at ExecutionContext._ExecutionContext_evaluate (.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:258:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (..../node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:146:16)
apears to be in @open-wa/wa-automate/dist/api/Client.js
this function
healthCheck() {
return __awaiter(this, void 0, void 0, function* () {
return yield this._page.evaluate(() => WAPI.healthCheck());
});
} i tried to mitigate the error by changing the function in node_modules, but the healthCheck does not work.
console.log('this._page=',this._page.evaluate);
const result = yield this._page.evaluate(() => {
console.log('wapi=',WAPI); WAPI is not executed.
Expected Behavior
I expect client.healthCheck to run normally. This is my implementation of the function client.healthCheck().then(function (val) { console.log("HealthCheck ", val); if (val.state = wa.STATE.CONNECTED && val.online) { var request = { method: 'post', url: HEARTBEAT_URL, }; console.log("Will send heartbeat"); axios(request).then(async function(response) { console.log("heartbeat successfull") }); } else { console.log("HealthCheck failed"); } And this is the setup of the client: wa.create({ sessionId: "COVID_HELPER", multiDevice: true, //required to enable multiDevice support authTimeout: 60, //wait only 60 seconds to get a connection with the host account devi> blockCrashLogs: true, disableSpins: true, headless: true, hostNotificationLang: 'PT_BR', logConsole: true, ezqr: true, popup: true, autoRefresh:false, qrTimeout: 0, //0 means it will wait forever for you to scan the qr code }).then(client => start(client));
Steps To Reproduce
function start(client) { console.log("This is the start");
try{
}
create() code OR full CLI command + CONFIG
No response
DEBUG INFO
Environment
Screenshots/Logs
Anything else?
No response