get undefined of Contact's name
Created by: BetaSu
I use puppeteer as puppet, and get undefined in callback of on('login') as value of user. In the minwhile, i Calling the following api
await bot.Contact.findAll()
and found their Contact are all undefined I can do nothing with it , hope your help~
Expected behavior
Actual behavior
Full Output Logs
# PASTE FULL LOG OUTPUT AT HERE:
11:13:22 SILL Config WECHATY_LOG set level to silly
11:13:22 INFO Config registering process.on("unhandledRejection") for development/debug
11:13:22 VERB Config constructor()
[2018-08-02T11:13:23.368] [24303] [INFO] - mongodb://127.0.0.1:27017/wxrobot?
11:13:23 SILL Accessory #0<Wechaty> constructor()
11:13:23 VERB Wechaty contructor()
11:13:23 VERB MemoryCard constructor(steamRobot)
11:13:23 VERB StateSwitch constructor(name=Wechaty)
11:13:23 VERB Wechaty on(scan, function) registered
11:13:23 VERB Wechaty onFunction(scan)
11:13:23 VERB Wechaty on(login, function) registered
11:13:23 VERB Wechaty onFunction(login)
11:13:23 VERB Wechaty on(message, function) registered
11:13:23 VERB Wechaty onFunction(message)
11:13:23 SILL Wechaty version() form development environment is not availble: ENOENT: no such file or directory, stat '/Users/gjt/Documents/wechaty-getting-started/node_modules/_wechaty@0.18.5@wechaty/dist/.git'
11:13:23 INFO Wechaty <puppeteer> start() v0.18.5 is starting...
11:13:23 VERB Wechaty puppet: puppeteer
11:13:23 VERB Wechaty profile: steamRobot
11:13:23 VERB Wechaty id: cjkbzjt8r0000r3l7dn2thl84
11:13:23 SILL StateSwitch <Wechaty> on() is false
11:13:23 SILL StateSwitch <Wechaty> on() is false
11:13:23 VERB StateSwitch <Wechaty> on(pending) <- (false)
11:13:23 VERB MemoryCard load() file: /Users/gjt/Documents/wechaty-getting-started/steamRobot.memory-card.json
11:13:23 VERB Wechaty initPuppet() puppeteer
11:13:23 VERB Wechaty initPuppetResolver(puppeteer)
11:13:23 VERB MemoryCard sub(puppeteer)
11:13:23 VERB MemoryCard static sub(MemoryCard<steamRobot>, puppeteer)
11:13:23 VERB MemoryCard constructor(steamRobot)
11:13:23 VERB PuppetConfig puppetResolver(puppeteer)
11:13:23 SILL PuppetConfig puppetResolver(puppeteer) import success.
11:13:23 VERB Puppet constructor({}) #0
11:13:23 VERB StateSwitch constructor(name=PuppetPuppeteer)
11:13:23 VERB MemoryCard constructor()
11:13:23 VERB Puppet constructor() watchdog timeout set to 60 seconds
11:13:23 VERB HotImport callerResolve(., /Users/gjt/Documents/wechaty-getting-started/node_modules/_wechaty-puppet@0.8.5@wechaty-puppet/dist/src/puppet.js)
11:13:23 SILL HotImport callerResolve() callsites() file=/Users/gjt/Documents/wechaty-getting-started/node_modules/_hot-import@0.2.1@hot-import/dist/src/hot-import.js, type=Object
11:13:23 SILL HotImport callerResolve() callsites() file=/Users/gjt/Documents/wechaty-getting-started/node_modules/_wechaty-puppet@0.8.5@wechaty-puppet/dist/src/puppet.js, type=null
11:13:23 SILL HotImport callerResolve() callsites() file=/Users/gjt/Documents/wechaty-getting-started/node_modules/_wechaty@0.18.5@wechaty/node_modules/wechaty-puppet-puppeteer/dist/src/puppet-puppeteer.js, type=null
11:13:23 SILL HotImport callerResolve() callerFile=/Users/gjt/Documents/wechaty-getting-started/node_modules/_wechaty@0.18.5@wechaty/node_modules/wechaty-puppet-puppeteer/dist/src/puppet-puppeteer.js
11:13:23 VERB Puppet constructor() childClassPath=/Users/gjt/Documents/wechaty-getting-started/node_modules/_wechaty@0.18.5@wechaty/node_modules/wechaty-puppet-puppeteer/dist/src
11:13:23 VERB PuppetPuppeteerBridge constructor()
11:13:23 VERB StateSwitch constructor(name=PuppetPuppeteerBridge)
11:13:23 VERB PuppetPuppeteer initWatchdogForScan()
11:13:23 VERB Puppet setMemory()
11:13:23 INFO Wechaty initPuppet() inited puppet: Puppet#0<PuppetPuppeteer>(steamRobot)
11:13:23 VERB Wechaty initPuppetVersionSatisfy(Puppet#0<PuppetPuppeteer>(steamRobot))
11:13:23 VERB Wechaty initPuppetSemverSatisfy(*)
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(friendship) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(login) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(logout) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(message) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(room-join) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(room-leave) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(room-topic) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(scan) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(dong) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(error) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(reset) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(start) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(stop) registered
11:13:23 VERB Wechaty initPuppetEventBridge() puppet.on(watchdog) registered
11:13:23 VERB Wechaty initAccessory(Puppet#0<PuppetPuppeteer>(steamRobot))
11:13:23 SILL Accessory <Contact> static set wechaty = "Wechaty#cjkbzjt8r0000r3l7dn2thl84<puppeteer>(steamRobot)"
11:13:23 SILL Accessory <ContactSelf> static set wechaty = "Wechaty#cjkbzjt8r0000r3l7dn2thl84<puppeteer>(steamRobot)"
11:13:23 SILL Accessory <Friendship> static set wechaty = "Wechaty#cjkbzjt8r0000r3l7dn2thl84<puppeteer>(steamRobot)"
11:13:23 SILL Accessory <Message> static set wechaty = "Wechaty#cjkbzjt8r0000r3l7dn2thl84<puppeteer>(steamRobot)"
11:13:23 SILL Accessory <Room> static set wechaty = "Wechaty#cjkbzjt8r0000r3l7dn2thl84<puppeteer>(steamRobot)"
11:13:23 SILL Accessory <Contact> static set puppet = "Puppet#0<PuppetPuppeteer>(steamRobot)"
11:13:23 SILL Accessory <ContactSelf> static set puppet = "Puppet#0<PuppetPuppeteer>(steamRobot)"
11:13:23 SILL Accessory <Friendship> static set puppet = "Puppet#0<PuppetPuppeteer>(steamRobot)"
11:13:23 SILL Accessory <Message> static set puppet = "Puppet#0<PuppetPuppeteer>(steamRobot)"
11:13:23 SILL Accessory <Room> static set puppet = "Puppet#0<PuppetPuppeteer>(steamRobot)"
11:13:23 SILL Accessory <Wechaty> set puppet = "Puppet#0<PuppetPuppeteer>(steamRobot)"
11:13:23 VERB PuppetPuppeteer start() with steamRobot
11:13:23 SILL StateSwitch <PuppetPuppeteer> on() is false
11:13:23 VERB StateSwitch <PuppetPuppeteer> on(pending) <- (false)
11:13:23 VERB PuppetPuppeteer initBridge()
11:13:23 SILL StateSwitch <PuppetPuppeteer> off() is false
11:13:23 VERB PuppetPuppeteerBridge start()
11:13:23 SILL StateSwitch <PuppetPuppeteerBridge> on() is false
11:13:23 VERB StateSwitch <PuppetPuppeteerBridge> on(pending) <- (false)
11:13:23 VERB PuppetPuppeteerBridge initBrowser()
11:13:23 VERB PuppetPuppeteerBridge initBrowser() version: HeadlessChrome/69.0.3494.0
11:13:23 VERB PuppetPuppeteerBridge start() initBrowser() done
11:13:23 VERB PuppetPuppeteerBridge initPage()
11:13:24 VERB MemoryCard <puppeteer> get(PUPPET_PUPPETEER)
11:13:24 VERB PuppetPuppeteerBridge cookieDomain([object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object])
11:13:24 SILL PuppetPuppeteerBridge cookieDomain() got https://wx2.qq.com
11:13:24 VERB PuppetPuppeteerBridge initPage() before page.goto(url)
11:13:24 VERB PuppetPuppeteerBridge initPage() after page.goto(url)
11:13:24 SILL PuppetPuppeteerBridge initPage() page.setCookie() 12 cookies set back
11:13:25 VERB PuppetPuppeteerBridge onLoad() page.url=https://wx2.qq.com/
11:13:25 SILL StateSwitch <PuppetPuppeteerBridge> off() is false
11:13:25 VERB PuppetPuppeteerBridge readyAngular()
11:13:25 VERB PuppetPuppeteerBridge inject()
11:13:25 SILL PuppetPuppeteerBridge inject() eval(Wechaty) return code[200] message[WechatyBro Inject Done]
11:13:25 SILL PuppetPuppeteerBridge proxyWechaty(init)
11:13:25 SILL PuppetPuppeteerEvent onLog(login(page refresh))
11:13:25 VERB PuppetPuppeteerEvent onLogin(page refresh, 30)
11:13:25 VERB PuppetPuppeteerBridge getUserName()
11:13:25 SILL PuppetPuppeteerBridge proxyWechaty(getUserName)
11:13:25 SILL PuppetPuppeteerEvent onLog(init() scanCode: null)
11:13:25 SILL PuppetPuppeteerEvent onLog(inited!. ;-D)
11:13:25 VERB PuppetPuppeteerEvent onLogin() browser not fully loaded(ttl=30), retry later
11:13:25 SILL PuppetPuppeteerBridge evaluate()
11:13:25 SILL PuppetPuppeteerBridge inject() Wechaty.init() return code[200] message[WechatyBro Init Succ]
11:13:25 VERB PuppetPuppeteerBridge ding(ding() OK!)
11:13:25 SILL PuppetPuppeteerBridge proxyWechaty(ding, ding() OK!)
11:13:25 SILL PuppetPuppeteerEvent onLogin() innerHTML:
<canvas style="position:absolute;top:0;left:0;bottom:0;right:0;z-index:-1;width:100%;height:100%;" id="heroCanvas"></canvas>
<!--[if lt IE 8]>
<p class="browsehappy">
你正在使用一个<strong>过时</strong>的浏览器。请<a class="link" href="http://browsehappy.com" target="_blank">升级你的浏览器</a>以查看微信网页版。</p>
</p>
<![endif]-->
<!--BEGIN login-->
<!-- ngIf: false -->
<!--END login-->
<!--BEGIN main-->
<div class="main">
<div class="main_inner" ng-right-click="showC
11:13:25 SILL PuppetPuppeteerEvent onLog(recv ding)
11:13:25 SILL PuppetPuppeteerBridge inject() ding success
11:13:25 VERB PuppetPuppeteerBridge clickSwitchAccount()
11:13:25 SILL PuppetPuppeteerBridge clickSwitchAccount() button not found
11:13:25 SILL StateSwitch <PuppetPuppeteerBridge> on() is pending
11:13:25 VERB StateSwitch <PuppetPuppeteerBridge> on(true) <- (pending)
11:13:25 VERB PuppetPuppeteerBridge start() initPage() done
11:13:25 VERB PuppetPuppeteer initBridge() done
11:13:25 SILL StateSwitch <PuppetPuppeteer> on() is pending
11:13:25 VERB StateSwitch <PuppetPuppeteer> on(true) <- (pending)
11:13:25 VERB PuppetPuppeteer start() done
11:13:25 VERB Wechaty on(heartbeat, function) registered
11:13:25 VERB Wechaty onFunction(heartbeat)
11:13:25 SILL StateSwitch <Wechaty> on() is pending
11:13:25 VERB StateSwitch <Wechaty> on(true) <- (pending)
11:13:26 SILL PuppetPuppeteerEvent onLog(checkScan() - already login, no more check, and return(only))
11:13:26 VERB PuppetPuppeteerEvent onLogin(page refresh, 29)
11:13:26 VERB PuppetPuppeteerBridge getUserName()
11:13:26 SILL PuppetPuppeteerBridge proxyWechaty(getUserName)
11:13:26 SILL PuppetPuppeteerEvent bridge.getUserName: @ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca
11:13:26 SILL PuppetPuppeteerEvent onLogin() user @ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca logined
11:13:26 VERB MemoryCard <puppeteer> set(PUPPET_PUPPETEER, [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object])
11:13:26 VERB MemoryCard <puppeteer> save() file: /Users/gjt/Documents/wechaty-getting-started/steamRobot.memory-card.json
11:13:26 VERB MemoryCard <> save() file: /Users/gjt/Documents/wechaty-getting-started/steamRobot.memory-card.json
11:13:26 VERB PuppetPuppeteer readyStable()
11:13:26 SILL PuppetPuppeteerBridge proxyWechaty(contactList)
11:13:27 SILL PuppetPuppeteerBridge proxyWechaty(contactList)
11:13:27 VERB PuppetPuppeteer readyStable() stable() READY length=3
11:13:27 VERB Puppet login(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca)
11:13:27 VERB Contact load(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca) init pool
11:13:27 SILL Accessory #1<Contact<undefined>> constructor()
11:13:27 SILL Contact constructor(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca)
11:13:27 SILL Contact ready() @ Puppet#0<PuppetPuppeteer>(steamRobot)
11:13:27 SILL Puppet contactPayload(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca) cache MISS
11:13:27 SILL Puppet contactPayload(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca) cache MISS
11:13:27 SILL PuppetPuppeteer contactRawPayload(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca) @ Puppet#0<PuppetPuppeteer>(steamRobot)
11:13:27 SILL PuppetPuppeteerBridge getContact(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca) retry attempt 1
11:13:27 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca)
11:13:27 SILL PuppetPuppeteer contactParseRawPayload(Object.keys(payload).length=21)
11:13:27 SILL Puppet contactPayload(@ae23cc9ab4e65a84f2624f4743d1ff4748ebfe57d4cf877ef7354f7ea94f7fca) cache SET