Closed jealvin closed 2 years ago
Can you add more details with your problem?
d found after refresh qrcode.
use qr requests each 20 second
How to refresh qr code without wait 20 second?
How to refresh qr code without wait 20 second?
use different id or delete used id first
yes here is it : while request qrcode from post /session/add im checking the user is connected using the session (/session/find/:id) first time got "Session not found." second request got "Session found." waiting for a while got "Session not found."
on the log its got this
{"level":30,"time":1646283218284,"pid":15284,"hostname":"DESKTOP-78ODD95","class":"baileys","error":{"data":null,"isBoom":true,"isServer":false,"output":{"statusCode":408,"payload":{"statusCode":408,"error":"Request Time-out","message":"QR refs atte
mpts ended"},"headers":{}}},"msg":"connection closed"}
@ookamiiixd
Can you add more details with your problem?
Well, during QR generation the session status will be found no matter it's connected or not because the socket has been started and the session id is on use. Is this clear for you now?
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for user
properties. For Beta Multi-Device session, check in session.user
. For Legacy (Normal WhatsApp Web) session, check in session.state.legacy.user
. Both should return undefined
if the session hasn't been authenticated.
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for
user
properties. For Beta Multi-Device session, check insession.user
. For Legacy (Normal WhatsApp Web) session, check insession.state.legacy.user
. Both should returnundefined
if the session hasn't been authenticated.
then we need to add new router to check session user is hasn't been authenticated or not.
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for
user
properties. For Beta Multi-Device session, check insession.user
. For Legacy (Normal WhatsApp Web) session, check insession.state.legacy.user
. Both should returnundefined
if the session hasn't been authenticated.then we need to add new router to check session user is hasn't been authenticated or not.
Yep, i might do this if i have free time.
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for
user
properties. For Beta Multi-Device session, check insession.user
. For Legacy (Normal WhatsApp Web) session, check insession.state.legacy.user
. Both should returnundefined
if the session hasn't been authenticated.then we need to add new router to check session user is hasn't been authenticated or not.
yes, i do that, but for 20 second if i hit /session/add, the session still found, so how many seconds for session/add can create new qr?
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for
user
properties. For Beta Multi-Device session, check insession.user
. For Legacy (Normal WhatsApp Web) session, check insession.state.legacy.user
. Both should returnundefined
if the session hasn't been authenticated.then we need to add new router to check session user is hasn't been authenticated or not.
yes, i do that, but for 20 second if i hit /session/add, the session still found, so how many seconds for session/add can create new qr?
Typically 20 seconds, if you want to wait until it available then add some seconds. 25-30 seconds should do.
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for
user
properties. For Beta Multi-Device session, check insession.user
. For Legacy (Normal WhatsApp Web) session, check insession.state.legacy.user
. Both should returnundefined
if the session hasn't been authenticated.then we need to add new router to check session user is hasn't been authenticated or not.
Yep, i might do this if i have free time.
already create it add into whatsapp.js
const isLogedin = (sessionId) =>{
const sessionFileLegacy = 'legacy_' + sessionId
const sessionFileMD = 'md_' + sessionId
var SESSION_FILE_PATH_LEGACY = join(__dirname, 'sessions', `${sessionFileLegacy}.json`);
var SESSION_FILE_PATH_MD = join(__dirname, 'sessions', `${sessionFileMD}.json`);
if (existsSync(SESSION_FILE_PATH_LEGACY) || existsSync(SESSION_FILE_PATH_MD) ) {
return true
}else{
return false
}
}
this func to check if session exists or not
How to refresh qr code without wait 20 second?
use different id or delete used id first
Yes, i try to delete first, but how to check if connect?
If you want to check if session has been successfully connected and authenticated, you can check for
user
properties. For Beta Multi-Device session, check insession.user
. For Legacy (Normal WhatsApp Web) session, check insession.state.legacy.user
. Both should returnundefined
if the session hasn't been authenticated.then we need to add new router to check session user is hasn't been authenticated or not.
yes, i do that, but for 20 second if i hit /session/add, the session still found, so how many seconds for session/add can create new qr?
Typically 20 seconds, if you want to wait until it available then add some seconds. 25-30 seconds should do.
its better if you create socket to detect if new QR recieved or not
If this already clear for you guys, i will close this issue.
Session id found after refresh qrcode.