wechaty / wechaty

Conversational RPA SDK for Chatbot Makers. Join our Discord: https://discord.gg/7q8NBZbQzt

Home Page:https://wechaty.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Qr Auth fails after a day

naishstar opened this issue · comments

Hi after 1-2 days our docker instance loses authorisation and we have to rescan a QR code. Is this normal? How long has anyone else kept an account authorised after first scanning a QR code. We were hoping to keep it long running as otherwise we miss messages? Any tips appreciated.

(PS. thanks for a great SDK)

To clarify we successfully scan QR, send and receive messages for around a day and then it stops working , no new messages come in and we can't reply. So have to rescan QR code. It is this we want to minimise so we don't miss messages in the time between losing auth and rescan. Thanks

Hi @naishstar ,

Thanks for submitting this issue, because how long will wechaty session keep valid inside browser is also the same question I want to know.

My suggestion for getting the answer, is to:

  1. open browser and login wechat by scan QRcode. then monitor it to see how long will wechat keep session for you.
  2. find someone work inside Tencent, ask them to know the session timeout/management strategy.
  3. find others who use wechaty(or other web wechat framework), we can summary the session time information to clarify it.

last but not least, there is no guarantee that the web wechat will keep your login at wechat side. you must be prepared for the session lost.

wechaty will emit logout & scan event to you, so you can monitor those events, either send an email to you to notice or use other tools like send QR code to you via wechat message(i.e. via ServerChan)

fighting!

Thanks @zixia

So far we think it is an inactivity timeout killing the sessions by wechat. So providing you have enough activity on a regular basis they should stay open. Our test one was too quiet so we think that caused the issue!

We will keep testing!