Closed suntong closed 3 years ago
{"UserName":"xx","Wxid":"xx","Tag8":0,"MemberContactFlag":1,"NickName":"xx"}],"nickName":"xx️"ÿ,"smallHeadUrl":"http://wx.qlogo.cn/mmcrhead/.../0","stranger":"v1_...@stranger","tagList":"","ticket":""}
Do you know what's this ÿ,
in the log which you provided?
Can you reproduce it always? It seem that contactRawPayloadParser
accepted a room
parameter.
Yeah, it is reproducible to me -- I'm getting it all the times.
And in deed that ÿ
seems to be the problem. Here is another one that I got, and it contains that ÿ
too:
{"UserName":"H..vi","Wxid":"H..vi","Tag8":0,"MemberContactFlag":1,"NickName":"Viv..⚈้̤͡ ˌ̫̮ ⚈้̤"ÿ},{"UserName":"kev...
It seem that contactRawPayloadParser accepted a room parameter
where can I find the API for the contactRawPayloadParser
. I know which groups I'm in is causing the problem. I want to see if manually triggering it would cause the same problem too.
where can I find the API for the
contactRawPayloadParser
.
You can get detail from the source code.
The exception of Object.contactRawPayloadParser
is at (/path/to/node_modules/wechaty-puppet-padplus/dist/src/pure-function-helpers/contact-raw-payload-parser.js:31:15
), while the .ts
source line 31 is --
I.e., the # 1 reason I hate .ts
is that when you have an exception like this, you'd have no idea where it comes from.
Anyway, I believe the UnhandledPromiseRejectionWarning
is coming from this line:
will probe further to see if I can trigger that call myself...
thx!
And in deed that ÿ seems to be the problem.
No! Find a group info that is perfectly valid (passed through the strict validation perfectly), but I'm still getting the UnhandledPromiseRejectionWarning
, with the exact same error messages.
So there is still something wrong with the Object.contactRawPayloadParser
, even with correct Payload.
The same issue was met here, but i found that this worked correctly with wechaty(0.46.4) & wechaty-puppet-padplus(0.6.5). After updating to wechaty(0.48.10) & wechaty-puppet-padplus(0.6.6), this issue occurs.
Follow your talking, just add print command to see what's difference between these two version about the rawPayload in contact-raw-payload-parser.js
then i found the difference, this rawPayload should be invitee‘s info, but this was instead by the room's info in wechaty-puppet-padplus(0.6.6)
So far i do not find out which codes are wrong, just sync what i found firstly
@suntong @tomallv Thank you for your issue.
wechaty-puppet-padplus@0.7.41
could resolve this problem. Please check it again, if there's no question about it, please feel free to close this issue. Thank you very much.
Thanks a lot working towards fixing it. I can't verify it now, but maybe 2 weeks later. Closing it now (and will reopen if something went wrong down the road)
Thanks again!
0. Report Issue Guide
Not fixed.
Not reported before.
1. Versions
What is your node version? (run
node --version
) Answer: v10.21.0What os are you using Answer:
2. Describe the bug
Recently I'm getting the following errors when running with
wechaty-puppet-padplus
:(node:69429) UnhandledPromiseRejectionWarning: Error: cannot get user_name from raw payload: {"alias":"","bigHeadUrl":"http://wx.qlogo.cn/mmcrhead/.../0","chatRoomOwner":"wxid_5j...w12","chatroomId":"60..940@chatroom","chatroomVersion":700003494,"contactType":"","memberCount":498,"members":[{"UserName":"wxid_5j..lw12","Wxid":"wxid_5j..lw12","Tag8":0,"MemberContactFlag":1,"NickName":"xxx"},{"UserName":"wxid_81er...c22","Wxid":...,{"UserName":"wxid_8k...m22","Wxid":"wxid_8k...m22","Tag8":0,"MemberContactFlag":1,"NickName":"xx."},{"UserName":"xx","Wxid":"xx","Tag8":0,"MemberContactFlag":1,"NickName":"xx"}],"nickName":"xx️"ÿ,"smallHeadUrl":"http://wx.qlogo.cn/mmcrhead/.../0","stranger":"v1_...@stranger","tagList":"","ticket":""} at Object.contactRawPayloadParser (/path/to/node_modules/wechaty-puppet-padplus/dist/src/pure-function-helpers/contact-raw-payload-parser.js:31:15) at PuppetPadplus.<anonymous> (/path/to/node_modules/wechaty-puppet-padplus/dist/src/puppet-padplus.js:379:58) at Generator.next (<anonymous>) at /path/to/node_modules/wechaty-puppet-padplus/dist/src/puppet-padplus.js:8:71 at new Promise (<anonymous>) at __awaiter (/path/to/node_modules/wechaty-puppet-padplus/dist/src/puppet-padplus.js:4:12) at PuppetPadplus.contactRawPayloadParser (/path/to/node_modules/wechaty-puppet-padplus/dist/src/puppet-padplus.js:377:16) at PuppetPadplus.<anonymous> (/path/to/node_modules/wechaty-puppet/dist/src/puppet.js:473:40) at Generator.next (<anonymous>) at fulfilled (/path/to/node_modules/wechaty-puppet/dist/src/pupp at Page.goto (/path/to/node_modules/puppeteer/lib/Page.js:553:53) at Page.<anonymous> (/path/to/node_modules/puppeteer/lib/helper.remote: Total 5 (delta 3), reused 0 (delta 0) Unpacking objects: 100% (5/5), done. et.js:5:58) (node:69429) 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: 9)
It has happened several times now, and it seems to be all happening to big groups that I joined, like the one above. I.e., all of them are around 500 users.
3. To Reproduce
Steps to reproduce the behavior:
ding-dong-bot.js
from https://github.com/wechaty/wechaty-getting-started/ withwechaty-puppet-padplus
as the puppetPuppetPadplus.contactRawPayloadParser
is somehow invoked. Seewechaty-puppet-padplus/dist/src/pure-function-helpers/contact-raw-payload-parser.js:31:15
andwechaty-puppet-padplus/dist/src/puppet-padplus.js:377:16
, andGenerator.next
atpuppet-padplus.js:8:71
.4. Expected behavior
Not seeing such error, as it had been before.
5. Actual behavior
I'm getting such errors recently.
6. Full Output Logs
As above.
7. Additional context
If you take a closer look at the json string, there is an extra "ÿ" before
"smallHeadUrl":
that is outside of string quote:{"UserName":"xx","Wxid":"xx","Tag8":0,"MemberContactFlag":1,"NickName":"xx"}],"nickName":"xx️"ÿ,"smallHeadUrl":"http://wx.qlogo.cn/mmcrhead/.../0","stranger":"v1_...@stranger","tagList":"","ticket":""}
This might be the reason for the parser to fail, as that extra "ÿ" should not be there, or at least within the quote
"
. However, this might well just be an output glitch, so I'm only pointing it out here, in hope it might help.[bug]