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
Apparently it's for no reason, the cell phone is connected and the statusSession of the create() method statusFind is equal to 'inChat'. All of this works normally and it sends messages normally.
The statusFind is changed whenever there is a change in the device status. However, after some time, the method kind of goes into a loop and keeps returning the statusFind 'inChat' all the time, causing the device to disconnect.
I placed a console.log to identify the time when the statusFind function was called with the "new" status.
Note that there is a pattern, but there is no warning of when this will occur, it simply starts to occur.
When this problem occurs and there is a reconnection attempt, I get the following error:
Error: WPP is not defined
at /home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:107:31
at step (/home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:49:23)
at Object.next (/home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:30:53)
at fulfilled (/home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:21:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
JS Stack: ReferenceError: WPP is not defined
at pptr:evaluate;%2Fhome%2Fr2-app%2Fr2-whatsapp-api%2Fnode_modules%2F%40wppconnect-team%2Fwppconnect%2Fdist%2Fapi%2Fhelpers%2Fevaluate-and-return.js%3A99%3A56:57:29
at pptr:evaluate;%2Fhome%2Fr2-app%2Fr2-whatsapp-api%2Fnode_modules%2F%40wppconnect-team%2Fwppconnect%2Fdist%2Fapi%2Fhelpers%2Fevaluate-and-return.js%3A99%3A56:58:28
at new Promise ()
at anonymous (pptr:evaluate;%2Fhome%2Fr2-app%2Fr2-whatsapp-api%2Fnode_modules%2F%40wppconnect-team%2Fwppconnect%2Fdist%2Fapi%2Fhelpers%2Fevaluate-and-return.js%3A99%3A56:54:14)
Function: function () {
return WPP.whatsapp.Socket.state;
}
Environment
WPPConnect version(s): 1.28.3
WA-JS version(s): 2.28.0
Browser: Chrome 119.0.6045.199
OS: Linux Ubuntu 22.04
Node version: Node 16.14.2
WhatsApp version: 2.2347.56
Steps to Reproduce
1 - Start the connect app
2 - Scan the QR Code and connect the device
3 - Wait and monitor the logs
The text was updated successfully, but these errors were encountered:
Description
Apparently it's for no reason, the cell phone is connected and the statusSession of the create() method statusFind is equal to 'inChat'. All of this works normally and it sends messages normally.
The statusFind is changed whenever there is a change in the device status. However, after some time, the method kind of goes into a loop and keeps returning the statusFind 'inChat' all the time, causing the device to disconnect.
I placed a console.log to identify the time when the statusFind function was called with the "new" status.
This is the method with console.log:
(statusSession, session) => {
console.log('statusSession --> ', statusSession, moment().tz(process.env.APP_TIMEZONE).format('DD/MM/YYYY HH:mm:ss'));
this.io.emit('status_connection', statusSession);
}
This is the console log:
DEBUG: 04/12/2023 18:49:22Whatsapp.statusFind (/home/app/project/app/Bo/WppBo.js:96:25)
statusSession --> inChat 04/12/2023 18:49:22
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Connected
DEBUG: 04/12/2023 18:49:23Whatsapp.statusFind (/home/app/project/app/Bo/WppBo.js:96:25)
statusSession --> inChat 04/12/2023 18:49:23
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Connected
DEBUG: 04/12/2023 19:02:34Whatsapp.statusFind (/home/app/project/app/Bo/WppBo.js:96:25)
statusSession --> inChat 04/12/2023 19:02:34
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Connected
DEBUG: 04/12/2023 19:02:36Whatsapp.statusFind (/home/app/project/app/Bo/WppBo.js:96:25)
statusSession --> inChat 04/12/2023 19:02:36
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Connected
DEBUG: 04/12/2023 20:16:08Whatsapp.statusFind (/home/app/project/app/Bo/WppBo.js:96:25)
statusSession --> inChat 04/12/2023 20:16:08
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Emitting onInterfaceChange event (1 registered)
[clientName:client] Current state: MAIN (NORMAL)
[clientName:client] Emitting onStateChange event (1 registered)
[clientName:client] Connected
DEBUG: 04/12/2023 20:16:09Whatsapp.statusFind (/home/app/project/app/Bo/WppBo.js:96:25)
statusSession --> inChat 04/12/2023 20:16:09
[clientName:client] Emitting onAnyMessage event (1 registered)
[clientName:client] Emitting onAnyMessage event (1 registered)
Note that there is a pattern, but there is no warning of when this will occur, it simply starts to occur.
When this problem occurs and there is a reconnection attempt, I get the following error:
Error: WPP is not defined
at /home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:107:31
at step (/home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:49:23)
at Object.next (/home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:30:53)
at fulfilled (/home/r2-app/r2-whatsapp-api/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:21:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
JS Stack: ReferenceError: WPP is not defined
at pptr:evaluate;%2Fhome%2Fr2-app%2Fr2-whatsapp-api%2Fnode_modules%2F%40wppconnect-team%2Fwppconnect%2Fdist%2Fapi%2Fhelpers%2Fevaluate-and-return.js%3A99%3A56:57:29
at pptr:evaluate;%2Fhome%2Fr2-app%2Fr2-whatsapp-api%2Fnode_modules%2F%40wppconnect-team%2Fwppconnect%2Fdist%2Fapi%2Fhelpers%2Fevaluate-and-return.js%3A99%3A56:58:28
at new Promise ()
at anonymous (pptr:evaluate;%2Fhome%2Fr2-app%2Fr2-whatsapp-api%2Fnode_modules%2F%40wppconnect-team%2Fwppconnect%2Fdist%2Fapi%2Fhelpers%2Fevaluate-and-return.js%3A99%3A56:54:14)
Function: function () {
return WPP.whatsapp.Socket.state;
}
Environment
Steps to Reproduce
1 - Start the connect app
2 - Scan the QR Code and connect the device
3 - Wait and monitor the logs
The text was updated successfully, but these errors were encountered: