juzibot / donut-tester

40 stars 4 forks source link

Same QR Code Shows Up Upon Login #28

Closed danielz02 closed 4 years ago

danielz02 commented 4 years ago

Important:Please file the issue follow the template, or we won't help you to solve the problem.

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:

    rm -rf package-lock.json
    rm -rf node_modules
    npm install

    Done

  2. Please search in FAQ List first, and make sure your problem has not been solved before. Done

  3. Please search in the issue first, and make sure your problem had not been reported before Done

1. Versions

2. Describe the bug

Last night, I logged off from the Windows WeChat through my phone and then logged in when I was trying to test my onReady handler. However, after running for several hours, the login QR code appeared on the terminal and the bot stopped working. I double checked my phone and it seemed that the Windows login was still there. I sent the login message to the BotSentry as usual but received a QR code instead of logging in directly. I scanned the QR code but it had already expired. Then I repeated this procedure for several times but I constantly got the same expired QR code.

3. To Reproduce

This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.

Steps to reproduce the behavior: I'm not sure how to describe the reproduction of this problem w/o spilling my serect key since it happens in the login phase but here's how I got into this problem:

4. Expected behavior

I should receive a new QR code when I login through the bot.

5. Actual behavior

If applicable, add screenshots to help explain your problem. But do not paste log screenshots here.

6. Full Output Logs

Set env WECHATY_LOG=silly in order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)

We need full log instead of log screenshot or log fragments! Sorry about this lengthy log message but I couldn't collapse the log message with code formatting.

16:58:52 SILL Puppet Config: WECHATY_LOG set level to silly

16:58:53 INFO Config registering process.on("unhandledRejection") for development/debug

16:58:53 VERB Config constructor()

Loading Config: [object Object]

16:58:53 VERB Wechaty constructor()

16:58:53 VERB Wechaty constructor() WechatyOptions.profile DEPRECATED. use WechatyOptions.name instead.

16:58:53 VERB StateSwitch constructor(Wechaty, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}")

16:58:53 VERB StateSwitch constructor(WechatyReady, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}")

16:58:53 VERB Wechaty on(scan, function) registered

16:58:53 VERB Wechaty addListenerFunction(scan)

16:58:53 VERB WechatyPluginContrib VoteOut({"room":["(Redacted)@chatroom","(Redacted)@chatroom"],"threshold":10,"whitelist":[],"downEmoji":["[弱]","[ThumbsDown]"],"warn":["您的聊天内容招致众怒,启动桃片放逐程序,当前票数为 {{ downNum }},当天累计票数达到 {{ threshold }} 时,你将被请出此群。"],"kick":"经 {{ voters }} 几人投票,你即将被放逐。","repeat":"你已经投票过 {{ votee }} 了,无需再投。"})

16:58:53 VERB WechatyPluginContrib roomMatcher(["(Redacted)@chatroom","(Redacted)@chatroom"])

16:58:53 VERB WechatyPluginContrib contactMatcher([])

16:58:53 VERB WechatyPluginContrib roomTalker("你已经投票过 {{ votee }} 了,无需再投。")

16:58:53 VERB WechatyPluginContrib roomTalker(["您的聊天内容招致众怒,启动桃片放逐程序,当前票数为 {{ downNum }},当天累计票数达到 {{ threshold }} 时,你将被请出此群。"])

16:58:53 VERB WechatyPluginContrib messageTalker("经 {{ voters }} 几人投票,你即将被放逐。")

16:58:53 VERB WechatyPluginContrib VoteOut() VoteOutPlugin(Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>())

16:58:53 VERB Wechaty on(heartbeat, function) registered

16:58:53 VERB Wechaty addListenerFunction(heartbeat)

16:58:53 VERB Wechaty on(message, function) registered

16:58:53 VERB Wechaty addListenerFunction(message)

16:58:53 VERB WechatyPluginContrib EventHotHandler("{"friendship":"../src/handlers/onFriendship","message":"../src/handlers/onMessage"}")

16:58:53 VERB HotImport callerResolve(../src/handlers/onFriendship, /home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-plugin-contrib/dist/src/contrib/event-hot-handler.js)

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/hot-import/dist/src/hot-import.js, type=Object

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-plugin-contrib/dist/src/contrib/event-hot-handler.js, type=Object

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/src/bot.js, type=Object

16:58:53 SILL HotImport callerResolve() callerFile=/home/danielz/WebstormProjects/icso-wechat-bot/src/bot.js

16:58:53 VERB HotImport callerResolve(../src/handlers/onMessage, /home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-plugin-contrib/dist/src/contrib/event-hot-handler.js)

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/hot-import/dist/src/hot-import.js, type=Object

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-plugin-contrib/dist/src/contrib/event-hot-handler.js, type=Object

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/src/bot.js, type=Object

16:58:53 SILL HotImport callerResolve() callerFile=/home/danielz/WebstormProjects/icso-wechat-bot/src/bot.js

16:58:53 VERB WechatyPluginContrib EventHotHandler installing on Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>() ...

16:58:53 VERB HotImport hotImport(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onFriendship, true)

16:58:53 VERB HotImport callerResolve(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onFriendship, undefined)

16:58:53 SILL HotImport importFile(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onFriendship.js)

16:58:53 VERB HotImport hotImport(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onMessage, true)

16:58:53 VERB HotImport callerResolve(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onMessage, undefined)

16:58:53 SILL HotImport importFile(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onMessage.js)

16:58:53 VERB Wechaty <wechaty-puppet-hostie>(ICSO Helper) start() v0.40.10 is starting...

16:58:53 VERB Wechaty id: ckbwrce9t00005t5n6cuiepwq

16:58:53 SILL StateSwitch <Wechaty> on() is false

16:58:53 SILL StateSwitch <WechatyReady> off() is true

16:58:53 VERB StateSwitch <WechatyReady> off(true) <- (true)

16:58:53 SILL StateSwitch <Wechaty> on() is false

16:58:53 VERB StateSwitch <Wechaty> on(pending) <- (false)

16:58:53 VERB MemoryCard constructor("ICSO Helper")

16:58:53 VERB MemoryCard getStorage() for storage type: N/A

16:58:53 VERB getStorage name: ICSO Helper, options: {"type":"file"}

16:58:53 VERB StorageFile constructor(ICSO Helper, ...)

16:58:53 VERB StorageBackend constructor(ICSO Helper, { type: file })

16:58:53 VERB MemoryCard load() from storage: StorageFile</home/danielz/WebstormProjects/icso-wechat-bot/ICSO Helper.memory-card.json>

16:58:53 VERB StorageFile load() from /home/danielz/WebstormProjects/icso-wechat-bot/ICSO Helper.memory-card.json

16:58:53 VERB MemoryCard load() file not exist, NOOP

16:58:53 VERB Wechaty initPuppet() wechaty-puppet-hostie

16:58:53 VERB MemoryCard multiplex(puppet)

16:58:53 VERB MemoryCard static multiplex(MemoryCard<ICSO Helper>, puppet)

16:58:53 VERB MemoryCard constructor({"name":"ICSO Helper","multiplex":{"name":"puppet","parent":{"options":{"name":"ICSO Helper"},"name":"ICSO Helper","payload":{},"multiplexNameList":[],"storage":{"name":"ICSO Helper","options":{"type":"file"},"absFileName":"/home/danielz/WebstormProjects/icso-wechat-bot/ICSO Helper.memory-card.json"}}}})

16:58:53 VERB PuppetManager resolve({puppet: wechaty-puppet-hostie, puppetOptions: {"token":"donut-test-user-(Redacted)"}})

16:58:53 VERB PuppetManager resolveName(wechaty-puppet-hostie)

16:58:53 VERB PuppetManager checkModule(wechaty-puppet-hostie)

16:58:53 SILL PuppetManager checkModule() wechaty-puppet-hostie installed version 0.8.3 satisfied range ^0.8.3

16:58:53 SILL HotImport initProxyModule(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onFriendship.js)

16:58:53 SILL HotImport cloneProperties()

16:58:53 SILL HotImport cloneProperties() cloning default

16:58:53 SILL HotImport makeHot(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onFriendship.js)

16:58:53 SILL HotImport initProxyModule(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onMessage.js)

16:58:53 SILL HotImport cloneProperties()

16:58:53 SILL HotImport cloneProperties() cloning default

16:58:53 SILL HotImport makeHot(/home/danielz/WebstormProjects/icso-wechat-bot/src/handlers/onMessage.js)

16:58:53 VERB Wechaty on(friendship, function) registered

16:58:53 VERB Wechaty addListenerFunction(friendship)

16:58:53 VERB Wechaty on(message, function) registered

16:58:53 VERB Wechaty addListenerFunction(message)

16:58:53 VERB Puppet constructor({"token":"donut-test-user-(Redacted)"}) #0

16:58:53 VERB StateSwitch constructor(PuppetHostie, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}")

16:58:53 VERB MemoryCard constructor(undefined)

16:58:53 VERB MemoryCard getStorage() for storage type: N/A

16:58:53 VERB MemoryCard load() from storage: N/A

16:58:53 VERB MemoryCard load() no storage

16:58:53 VERB Puppet constructor() watchdog timeout set to 60 seconds

16:58:53 VERB HotImport callerResolve(., /home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-puppet/dist/src/puppet.js)

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/hot-import/dist/src/hot-import.js, type=Object

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-puppet/dist/src/puppet.js, type=null

16:58:53 SILL HotImport callerResolve() callsites() file=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-puppet-hostie/dist/src/client/puppet-hostie.js, type=null

16:58:53 SILL HotImport callerResolve() callerFile=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-puppet-hostie/dist/src/client/puppet-hostie.js

16:58:53 VERB Puppet constructor() childClassPath=/home/danielz/WebstormProjects/icso-wechat-bot/node_modules/wechaty-puppet-hostie/dist/src/client

16:58:53 VERB Puppet constructor() memory.load() done

16:58:53 VERB Puppet setMemory()

16:58:53 VERB Wechaty initPuppetEventBridge(Puppet#0<PuppetHostie>(ICSO Helper))

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(friendship) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(login) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(logout) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(message) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(room-invite) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(room-join) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(room-leave) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(room-topic) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(scan) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(dong) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(error) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(heartbeat) (listenerCount:1) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(ready) (listenerCount:0) registering...

16:58:53 VERB Wechaty initPuppetEventBridge() puppet.on(reset) (listenerCount:1) registering...

16:58:53 VERB Wechaty initAccessory(Puppet#0<PuppetHostie>(ICSO Helper))

16:58:53 SILL Accessory <Contact> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <ContactSelf> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <Friendship> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <Image> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <Message> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <Room> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <RoomInvitation> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <Tag> static set wechaty = "Wechaty#ckbwrce(Redacted)<wechaty-puppet-hostie>(ICSO Helper)"

16:58:53 SILL Accessory <Contact> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <ContactSelf> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <Friendship> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <Image> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <Message> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <Room> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <RoomInvitation> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 SILL Accessory <Tag> static set puppet = "Puppet#0<PuppetHostie>(ICSO Helper)"

16:58:53 VERB PuppetHostie start()

16:58:53 SILL StateSwitch <PuppetHostie> on() is false

16:58:53 SILL StateSwitch <PuppetHostie> on() is false

16:58:53 VERB StateSwitch <PuppetHostie> on(pending) <- (false)

16:58:53 VERB PuppetHostie startGrpcClient()

16:58:53 VERB PuppetHostie discoverHostieIp(donut-test-user-**(Redacted)**)

16:58:53 VERB PuppetHostie startGrpcStream()

16:58:54 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_SCAN(22), payload:"
{"qrcode":"http://weixin.qq.com/x/YuR07kI**Redacted**","status":2}"})

[QR Code]

16:58:54 SILL StateSwitch <PuppetHostie> on() is pending

16:58:54 VERB StateSwitch <PuppetHostie> on(true) <- (pending)

16:58:54 VERB Puppet recover$() switchOn$ fired

16:58:54 VERB Puppet recover$() heartbeat: undefined

16:58:54 VERB Puppet recover$() switchOn$ fired

16:58:54 VERB Puppet recover$() heartbeat: undefined

16:58:54 VERB Wechaty on(heartbeat, function) registered

16:58:54 VERB Wechaty addListenerFunction(heartbeat)

16:58:54 SILL StateSwitch <Wechaty> on() is pending

16:58:54 VERB StateSwitch <Wechaty> on(true) <- (pending)

16:59:09 VERB Puppet recover$() heartbeatDing()

16:59:09 SILL PuppetHostie ding(recover$() CPR #0)

16:59:09 VERB PuppetHostie constructor() recover$().subscribe() next(0)

16:59:09 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

16:59:09 SILL Wechaty memoryCheck() free: 665 MB, require: 4 MB

16:59:09 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:09 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:24 VERB Puppet recover$() heartbeatDing()

16:59:24 SILL PuppetHostie ding(recover$() CPR #0)

16:59:24 VERB PuppetHostie constructor() recover$().subscribe() next(0)

16:59:25 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

16:59:25 SILL Wechaty memoryCheck() free: 646 MB, require: 4 MB

16:59:25 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:25 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:40 VERB Puppet recover$() heartbeatDing()

16:59:40 SILL PuppetHostie ding(recover$() CPR #0)

16:59:40 VERB PuppetHostie constructor() recover$().subscribe() next(0)

16:59:40 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

16:59:40 SILL Wechaty memoryCheck() free: 654 MB, require: 4 MB

16:59:40 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:40 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:55 VERB Puppet recover$() heartbeatDing()

16:59:55 SILL PuppetHostie ding(recover$() CPR #0)

16:59:55 VERB PuppetHostie constructor() recover$().subscribe() next(0)

16:59:55 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

16:59:55 SILL Wechaty memoryCheck() free: 650 MB, require: 4 MB

16:59:55 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

16:59:55 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:10 VERB Puppet recover$() heartbeatDing()

17:00:10 SILL PuppetHostie ding(recover$() CPR #0)

17:00:10 VERB PuppetHostie constructor() recover$().subscribe() next(0)

17:00:11 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

17:00:11 SILL Wechaty memoryCheck() free: 647 MB, require: 4 MB

17:00:11 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:11 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:26 VERB Puppet recover$() heartbeatDing()

17:00:26 SILL PuppetHostie ding(recover$() CPR #0)

17:00:26 VERB PuppetHostie constructor() recover$().subscribe() next(0)

17:00:26 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

17:00:26 SILL Wechaty memoryCheck() free: 651 MB, require: 4 MB

17:00:26 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:26 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:41 VERB Puppet recover$() heartbeatDing()

17:00:41 SILL PuppetHostie ding(recover$() CPR #0)

17:00:41 VERB PuppetHostie constructor() recover$().subscribe() next(0)

17:00:41 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_DONG(3), payload:"{"data":"recover$() CPR #0"}"})

17:00:41 SILL Wechaty memoryCheck() free: 643 MB, require: 4 MB

17:00:41 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:41 VERB Puppet recover$() heartbeat: {"data":"onGrpcStreamEvent(EVENT_TYPE_DONG)","timeout":60000}

17:00:56 VERB Puppet recover$() heartbeatDing()

17:00:56 SILL PuppetHostie ding(recover$() CPR #0)

7. Additional context

Everything worked well until I clicked "logged out from Windows device" on my phone.

[bug]

danielz02 commented 4 years ago

Solved