Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

room-join cannot get member #1324

Closed
lijiarui opened this issue Jun 13, 2018 · 2 comments
Closed

room-join cannot get member #1324

lijiarui opened this issue Jun 13, 2018 · 2 comments
Labels

Comments

@lijiarui
Copy link
Member

lijiarui commented Jun 13, 2018

room-join event cannot get member when the event is emitted.

.on('room-join', async function(room, inviteeList, inviter) {
  log.info( 'Bot', 'EVENT: room-join - Room %s got new member %s, invited by %s',
            await room.topic(),
            inviteeList.map(c => c.name()).join(','),
            inviter.name(),
          )
  const topic = await room.topic()
  room.say(`welcome to ${topic}!`, inviteeList[0])
})

Expect

20:10:04 INFO Bot EVENT: room-join - Room 线上机器人_3 got new member 李佳芮 , invited by 苏轼

Actual

20:10:04 INFO Bot EVENT: room-join - Room 线上机器人_3 got new member , invited by 苏轼

20:09:55 SILL PadchatRpc initHeartbeat() throttleQueue.subscribe(ws.on(message))
20:09:55 SILL PuppetPadchat startWatchdog() bridge.on(heartbeat)
20:09:55 SILL PuppetPadchat startWatchdog() watchdog.on(feed, food={type=undefined, data=ws.on(message)})
20:09:56 VERB PuppetPadchat onPadchatMessage({id=2282760660631983436, type=StatusNotify(5)})
rawPayload: { content:
   '<msg>\n<op id=\'2\'>\n<username>4174082170@chatroom</username>\n</op>\n</msg>',
  continue: 1,
  description: '',
  from_user: 'wxid_zj2cahpwzgie12',
  msg_id: '2282760660631983436',
  msg_source: '',
  msg_type: 5,
  status: 1,
  sub_type: 51,
  timestamp: 1528891795,
  to_user: '4174082170@chatroom',
  uin: 324216852 }
20:09:56 VERB Message static create(2282760660631983436)
20:09:56 SILL Accessory #24<Message> constructor()
20:09:56 VERB Message constructor(2282760660631983436) for class Message
20:09:56 VERB Message ready()
20:09:56 SILL Puppet messagePayloadCache(2282760660631983436) cache MISS
20:09:56 VERB Puppet messagePayload(id=2282760660631983436, noCache=false)
20:09:56 SILL Puppet messagePayloadCache(2282760660631983436) cache MISS
20:09:56 VERB PuppetPadChat messageRawPayloadParser({msg_id="2282760660631983436"})
20:09:56 SILL PuppetPadchat messagePayload({"id":"2282760660631983436","timestamp":1528891795,"text":"<msg>\n<op id='2'>\n<username>4174082170@chatroom</username>\n</op>\n</msg>","type":0,"fromId":"wxid_zj2cahpwzgie12","roomId":"4174082170@chatroom"})
20:09:56 SILL Puppet messagePayload(2282760660631983436) cache SET
20:09:56 SILL Contact ready() @ PuppetPadchat<default>
20:09:56 SILL Contact ready() isReady() true
20:09:56 VERB Room ready()
20:09:56 VERB Room topic()
20:09:56 SILL Contact alias()
[线上机器人_3]<苏轼>:Message#Unknown(Room<线上机器人_3>▲Contact<苏轼>►)<<msg>
<op id='2'>
<username>4174082170@chatroom</username>
</op>
</msg>
20:09:56 VERB Puppet selfId()
20:09:58 SILL PuppetPadchatManager syncRoomMember(8415007221@chatroom)
20:09:58 SILL PadchatRpc rpcCall(WXGetChatRoomMember, ["8415007221@chatroom"])
20:09:58 VERB PuppetPadchatManager startQueues() delayQueueExecutor.subscribe(syncRoomMember(8415007221@chatroom)) executed
20:09:59 SILL PadchatRpc WXGetChatRoomMember() result: {"chatroom_id":700000001,"count":3,"member":"[{\"big_head\":\"http://wx.qlogo.cn/mmhead/ver_1/Y9W8tLiasksdThST5JCJpsfhZDhxNFVrQfdTlicudK1T7g1Y93icScbEIlGRfWZH6I7pyyfC9ECF8tw70Q4sLVTLA/0\",\"chatroom_nick_name\":\"\",\"invited_by\":\"wxid_zj2cahpwzgie12\",\"nick_name\":\"梦君君\",\"small_head\":\"http://wx.qlogo.cn/mmhead/ver_1/Y9W8tLiasksdThST5JCJpsfhZDhxNFVrQfdTlicudK1T7g1Y93icScbEIlGRfWZH6I7pyyfC9ECF8tw70Q4sLVTLA/132\",\"user_name\":\"mengjunjun001\"},{\"big_head\":\"http://wx.qlogo.cn/mmhead/ver
20:09:59 SILL PuppetPadchatManager syncRoomMember(8415007221@chatroom) total 6 members
20:10:04 VERB PuppetPadchat onPadchatMessage({id=5703673574348750197, type=Recalled(5)})
rawPayload: { content:
   '4174082170@chatroom:\n<sysmsg type="delchatroommember">\n\t<delchatroommember>\n\t\t<plain><![CDATA[你邀请"李佳芮"加入了群聊  ]]></plain>\n\t\t<text><![CDATA[你邀请"李佳芮"加入了群聊  ]]></text>\n\t\t<link>\n\t\t\t<scene>invite</scene>\n\t\t\t<text><![CDATA[  撤销]]></text>\n\t\t\t<memberlist>\n\t\t\t\t<username><![CDATA[qq512436430]]></username>\n\t\t\t</memberlist>\n\t\t</link>\n\t</delchatroommember>\n</sysmsg>\n',
  continue: 1,
  description: '',
  from_user: '4174082170@chatroom',
  msg_id: '5703673574348750197',
  msg_source: '',
  msg_type: 5,
  status: 1,
  sub_type: 10002,
  timestamp: 1528891803,
  to_user: 'wxid_zj2cahpwzgie12',
  uin: 324216852 }
20:10:04 VERB PuppetPadchat onPadchatMessageRoomEvent({id=undefined})
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, "李佳芮")
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, {"name":"李佳芮"})
20:10:04 VERB PuppetPadchat roomMemberList(4174082170@chatroom)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170) length=2
20:10:04 SILL PuppetPadchat roomMemberList()=2
20:10:04 VERB Puppet contactSearch(query={"name":"李佳芮"}, idList.length = 2)
20:10:04 VERB Puppet contactQueryFilterFactory({"name":"李佳芮"})
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, {"contactAlias":"李佳芮"})
20:10:04 VERB PuppetPadchat roomMemberList(4174082170@chatroom)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170)
20:10:04 ERR Config ###########################
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170) length=2
20:10:04 SILL PuppetPadchat roomMemberList()=2
20:10:04 VERB Puppet contactSearch(query={"alias":"李佳芮"}, idList.length = 2)
20:10:04 VERB Puppet contactQueryFilterFactory({"alias":"李佳芮"})
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, {"roomAlias":"李佳芮"})
20:10:04 VERB PuppetPadchat roomMemberList(4174082170@chatroom)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170) length=2
20:10:04 SILL PuppetPadchat roomMemberList()=2
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, undefined)
20:10:04 VERB Room ready()
20:10:04 SILL Contact ready() @ PuppetPadchat<default>
20:10:04 SILL Contact ready() isReady() true
20:10:04 VERB Room topic()
20:10:04 INFO Bot EVENT: room-join - Room 线上机器人_3 got new member , invited by 苏轼
20:10:04 VERB Room topic()
20:10:04 VERB Room say(welcome to 线上机器人_3!, )
20:10:04 ERR Config unhandledRejection: TypeError: Cannot read property 'id' of undefined [object Promise]
20:10:04 ERR Config ###########################
20:10:04 ERR Config process.on(unhandledRejection) promise.catch(Cannot read property 'id' of undefined)
Config TypeError: Cannot read property 'id' of undefined
    at AnotherOriginalClass.<anonymous> (/Users/egg/git/rui/wechaty/src/room.ts:321:35)
    at Generator.next (<anonymous>)
    at /Users/egg/git/rui/wechaty/src/room.ts:27:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/egg/git/rui/wechaty/src/room.ts:23:12)
    at AnotherOriginalClass.say (/Users/egg/git/rui/wechaty/src/room.ts:254:16)
    at Wechaty.<anonymous> (/Users/egg/git/rui/wechaty/examples/room-bot.ts:131:8)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/egg/git/rui/wechaty/examples/room-bot.ts:5:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18399) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)

20:10:04 VERB PuppetPadchat onPadchatMessage({id=5703673574348750197, type=Recalled(5)})
rawPayload: { content:
   '4174082170@chatroom:\n<sysmsg type="delchatroommember">\n\t<delchatroommember>\n\t\t<plain><![CDATA[你邀请"李佳芮"加入了群聊  ]]></plain>\n\t\t<text><![CDATA[你邀请"李佳芮"加入了群聊  ]]></text>\n\t\t<link>\n\t\t\t<scene>invite</scene>\n\t\t\t<text><![CDATA[  撤销]]></text>\n\t\t\t<memberlist>\n\t\t\t\t<username><![CDATA[qq512436430]]></username>\n\t\t\t</memberlist>\n\t\t</link>\n\t</delchatroommember>\n</sysmsg>\n',
  continue: 1,
  description: '',
  from_user: '4174082170@chatroom',
  msg_id: '5703673574348750197',
  msg_source: '',
  msg_type: 5,
  status: 1,
  sub_type: 10002,
  timestamp: 1528891803,
  to_user: 'wxid_zj2cahpwzgie12',
  uin: 324216852 }
20:10:04 VERB PuppetPadchat onPadchatMessageRoomEvent({id=undefined})
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, "李佳芮")
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, {"name":"李佳芮"})
20:10:04 VERB PuppetPadchat roomMemberList(4174082170@chatroom)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170) length=2
20:10:04 SILL PuppetPadchat roomMemberList()=2
20:10:04 VERB Puppet contactSearch(query={"name":"李佳芮"}, idList.length = 2)
20:10:04 VERB Puppet contactQueryFilterFactory({"name":"李佳芮"})
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, {"contactAlias":"李佳芮"})
20:10:04 VERB PuppetPadchat roomMemberList(4174082170@chatroom)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170) length=2
20:10:04 SILL PuppetPadchat roomMemberList()=2
20:10:04 VERB Puppet contactSearch(query={"alias":"李佳芮"}, idList.length = 2)
20:10:04 VERB Puppet contactQueryFilterFactory({"alias":"李佳芮"})
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, {"roomAlias":"李佳芮"})
20:10:04 VERB PuppetPadchat roomMemberList(4174082170@chatroom)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170)
20:10:04 VERB PuppetPadchatManager getRoomMemberIdList(4174082170) length=2
20:10:04 SILL PuppetPadchat roomMemberList()=2
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberPayload(roomId=4174082170@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
20:10:04 SILL Puppet roomMemberPayloadCache(id=4174082170@chatroom) @ PuppetPadchat<default>
20:10:04 VERB Puppet roomMemberSearch(4174082170@chatroom, undefined)
20:10:04 VERB Room ready()
20:10:04 SILL Contact ready() @ PuppetPadchat<default>
20:10:04 SILL Contact ready() isReady() true
20:10:04 VERB Room topic()
20:10:04 INFO Bot EVENT: room-join - Room 线上机器人_3 got new member , invited by 苏轼
20:10:04 VERB Room topic()
20:10:04 VERB Room say(welcome to 线上机器人_3!, )
20:10:04 ERR Config ###########################
20:10:04 ERR Config unhandledRejection: TypeError: Cannot read property 'id' of undefined [object Promise]
20:10:04 ERR Config ###########################
20:10:04 ERR Config process.on(unhandledRejection) promise.catch(Cannot read property 'id' of undefined)
Config TypeError: Cannot read property 'id' of undefined
    at AnotherOriginalClass.<anonymous> (/Users/egg/git/rui/wechaty/src/room.ts:321:35)
    at Generator.next (<anonymous>)
    at /Users/egg/git/rui/wechaty/src/room.ts:27:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/egg/git/rui/wechaty/src/room.ts:23:12)
    at AnotherOriginalClass.say (/Users/egg/git/rui/wechaty/src/room.ts:254:16)
    at Wechaty.<anonymous> (/Users/egg/git/rui/wechaty/examples/room-bot.ts:131:8)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/egg/git/rui/wechaty/examples/room-bot.ts:5:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18399) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)
@huan
Copy link
Member

huan commented Jun 13, 2018

This issue should have been fixed by the last commit.

@lijiarui
Copy link
Member Author

fix this, but a new bug: #1330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants