when room leaver is bot, throw error.
Created by: JesseWeb
Important:Please file the issue follow the template, or we won't help you to solve the problem.
0. Report Issue Guide
- Please run the following command and check whether the problem has been fixed:
rm -rf package-lock.json
rm -rf node_modules
npm install
-
Please search in FAQ List first, and make sure your problem has not been solved before.
-
Please search in the issue first, and make sure your problem had not been reported before
1. Versions
-
What is your wechaty version? Answer: ^0.38.4
-
Which puppet are you using for wechaty? (padchat/puppeteer/padpro/...) Answer: wechaty-puppet-padplus
-
What is your wechaty-puppet-XXX(padchat/puppeteer/) version? Answer: ^0.6.1
-
What is your node version? (run
node --version
) Answer:10.15.3 -
What os are you using Answer: MacOS
2. Describe the bug
Give a clear and concise description of what the bug is. when bot got kick out of room, terminal got error
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.
let wechaty = new Wechaty({
name: WECHATY_NAME,
puppet: 'wechaty-puppet-padplus',
puppetOptions: {
token: PUPPET_PAD_PLUS_TOKEN
}
})
wechaty.start()
Steps to reproduce the behavior:
- start the bot.
- invite bot into a room.
- say sth in that room.
- kick bot out of room.
4. Expected behavior
no error. room-leave
triggering. terminal won't exit.
5. Actual behavior
(node:375) UnhandledPromiseRejectionWarning: Error: contact(christmasman001) is not in the Room(23769482744@chatroom)
at PuppetPadplus.<anonymous> (/Users/legendary_jesse/demos/wechaty-demo/node_modules/wechaty-puppet/src/puppet.ts:1421:13)
at Generator.next (<anonymous>)
at fulfilled (/Users/legendary_jesse/demos/wechaty-demo/node_modules/wechaty-puppet/dist/src/puppet.js:23:58)
warning.js:18
(node:375) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
warning.js:18
(node:375) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
warning.js:18
(node:375) UnhandledPromiseRejectionWarning: Error: contact(christmasman001) is not in the Room(23769482744@chatroom)
at PuppetPadplus.<anonymous> (/Users/legendary_jesse/demos/wechaty-demo/node_modules/wechaty-puppet/src/puppet.ts:1421:13)
at Generator.next (<anonymous>)
at fulfilled (/Users/legendary_jesse/demos/wechaty-demo/node_modules/wechaty-puppet/dist/src/puppet.js:23:58)
warning.js:18
(node:375) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)Ï
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!
Show Logs
23:50:54 SILL PadplusManager delete contact data : { field: '23769482744@chatroom',
uin: '1834906200',
userName: 'christmasman001',
mqType: 4 }
brolog.js:190
23:50:54 SILL ==P==A==D==P==L==U==S==<GRPC DATA>==P==A==D==P==L==U==S==
brolog.js:190
23:50:54 SILL GRPC_GATEWAY responseType: MESSAGE_RECEIVE, data : {"Status":4,"CreateTime":1588261853255,"FileName":"","NewMsgId":4760931375558080781,"msgSourceCd":2,"ToUserName":"christmasman001","MsgType":10000,"L1MsgType":5,"ImgStatus":1,"wechatUserName":"christmasman001","MsgId":"4760931375558080781","MsgSource":"","PushContent":"","ImgBuf":"","Content":"你被\"王墨炱\"移出群聊","FromUserName":"23769482744@chatroom","Uin":"1834906200"}
brolog.js:190
23:50:54 SILL ==P==A==D==P==L==U==S==<GRPC DATA>==P==A==D==P==L==U==S==
brolog.js:190
23:50:54 SILL PuppetPadplus roomRawPayload(23769482744@chatroom)
brolog.js:190
23:50:54 SILL PuppetPadplus onRoomJoinEvent(4760931375558080781)
brolog.js:190
23:50:54 SILL PuppetPadplus onRoomLeaveEvent(4760931375558080781)
brolog.js:190
23:50:54 SILL PuppetPadplus receive room-leave event : { leaverNameList: [ Symbol(You) ],
removerName: '王墨炱',
roomId: '23769482744@chatroom',
timestamp: 1588261853255 }
brolog.js:190
23:50:54 VERB Puppet roomMemberSearch(23769482744@chatroom, undefined)
brolog.js:190
23:50:54 SILL PuppetPadplus onRoomTopicEvent(4760931375558080781)
brolog.js:190
23:50:54 SILL PuppetPadplus onPadplusMessageFriendshipEvent({id=4760931375558080781})
brolog.js:190
23:50:54 VERB Puppet roomMemberSearch(23769482744@chatroom, "王墨炱")
brolog.js:190
23:50:54 VERB Puppet roomMemberSearch(23769482744@chatroom, {"roomAlias":"王墨炱"})
brolog.js:190
23:50:54 SILL PuppetPadplus roomMemberList(23769482744@chatroom)
brolog.js:190
23:50:54 VERB Puppet roomMemberPayload(roomId=23769482744@chatroom, memberId=wxid_1vkuzpbwo06w11)
brolog.js:190
23:50:54 SILL PuppetPadplus roomMemberRawPayload(23769482744@chatroom, wxid_1vkuzpbwo06w11)
brolog.js:190
23:50:54 VERB Puppet roomMemberPayload(roomId=23769482744@chatroom, memberId=xyzcain)
brolog.js:190
23:50:54 SILL PuppetPadplus roomMemberRawPayload(23769482744@chatroom, xyzcain)
brolog.js:190
23:50:54 VERB Puppet roomMemberPayload(roomId=23769482744@chatroom, memberId=christmasman001)
brolog.js:190
23:50:54 SILL PuppetPadplus roomMemberRawPayload(23769482744@chatroom, christmasman001)
brolog.js:190
23:50:54 SILL PuppetPadplus roomMemberRawPayloadParser()
brolog.js:190
23:50:54 SILL Puppet roomMemberPayload(23769482744@chatroom) cache SET
brolog.js:190
23:50:54 SILL PuppetPadplus roomMemberRawPayloadParser()
brolog.js:190
23:50:54 SILL Puppet roomMemberPayload(23769482744@chatroom) cache SET
brolog.js:190
23:50:54 ERR Config ###########################
brolog.js:173
23:50:54 ERR Config unhandledRejection: Error: contact(christmasman001) is not in the Room(23769482744@chatroom) [object Promise]
brolog.js:173
23:50:54 ERR Config ###########################
brolog.js:173
23:50:54 ERR Config process.on(unhandledRejection) promise.catch(contact(christmasman001) is not in the Room(23769482744@chatroom))
brolog.js:173
Config
config.ts:95
Error: contact(christmasman001) is not in the Room(23769482744@chatroom)
config.ts:95
(node:3719) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)
warning.js:18
23:50:55 SILL ==P==A==D==P==L==U==S==<GRPC DATA>==P==A==D==P==L==U==S==
brolog.js:190
23:50:55 SILL GRPC_GATEWAY responseType: CONTACT_DELETE, data : {"field":"23769482744@chatroom","uin":"1834906200","userName":"christmasman001","mqType":4}
brolog.js:190
23:50:55 SILL ==P==A==D==P==L==U==S==<GRPC DATA>==P==A==D==P==L==U==S==
brolog.js:190
23:50:55 SILL PadplusManager delete contact data : { field: '23769482744@chatroom',
uin: '1834906200',
userName: 'christmasman001',
mqType: 4 }
7. Additional context
Add any other context about the problem here.
-
the room only have 3 people, it doesn't needs confirm operation or send room invite message.
-
this bug wasn't always happen. but frequency is high enough to be fixed. [bug]