-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
WXGetContact cannot get user_name #1358
Labels
Comments
I found this issue here, in public async contactRawPayload(contactId: string): Promise<PadchatContactPayload> {
log.silly('PuppetPadchatManager', 'contactRawPayload(%s)', contactId)
const rawPayload = await Misc.retry(async (retry, attempt) => {
log.silly('PuppetPadchatManager', 'contactRawPayload(%s) retry() attempt=%d', contactId, attempt)
if (!this.cacheContactRawPayload) {
throw new Error('no cache')
}
if (this.cacheContactRawPayload.has(contactId)) {
return this.cacheContactRawPayload.get(contactId)
}
- const tryRawPayload = await this.WXGetContactPayload(contactId)
+ const tryRawPayload = await this.WXSearchContactPayload(contactId)
// check user_name too becasue the server might return {}
// See issue #1358 https://github.com/Chatie/wechaty/issues/1358
if (tryRawPayload /* && tryRawPayload.user_name */) {
this.cacheContactRawPayload.set(contactId, tryRawPayload)
return tryRawPayload
}
return retry(new Error('tryRawPayload empty'))
})
if (!rawPayload) {
throw new Error('no raw payload')
}
return rawPayload
} I think maybe we should change see more: Also, when I syncContact the the strange error, I think this relate to the WXGetContact 00:23:58 WARN PadchatRpc WXGetContact cannot get user_name, id: lizhuohuan, "{}"
00:23:58 ERR Contact ready() this.puppet.contactPayload(Contact) exception: cannot get user_name from raw payload: {}
(node:74322) UnhandledPromiseRejectionWarning: Error: cannot get user_name from raw payload: {}
at Object.contactRawPayloadParser (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/pure-function-helpers/contact-raw-payload-parser.ts:42:11)
at PuppetPadchat.<anonymous> (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:700:37)
at Generator.next (<anonymous>)
at /Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:25:71
at new Promise (<anonymous>)
at __awaiter (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:21:12)
at PuppetPadchat.contactRawPayloadParser (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:522:16)
at PuppetPadchat.<anonymous> (/Users/jiaruili/git/rui/wechaty/src/puppet/puppet.ts:494:35)
at Generator.next (<anonymous>)
at fulfilled (/Users/jiaruili/git/rui/wechaty/src/puppet/puppet.ts:4:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:74322) 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: 54)
{}
00:23:59 WARN PadchatRpc WXGetContact cannot get user_name, id: lizhuohuan, "{}"
00:23:59 ERR Contact ready() this.puppet.contactPayload(Contact) exception: cannot get user_name from raw payload: {}
(node:74322) UnhandledPromiseRejectionWarning: Error: cannot get user_name from raw payload: {}
at Object.contactRawPayloadParser (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/pure-function-helpers/contact-raw-payload-parser.ts:42:11)
at PuppetPadchat.<anonymous> (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:700:37)
at Generator.next (<anonymous>)
at /Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:25:71
at new Promise (<anonymous>)
at __awaiter (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:21:12)
at PuppetPadchat.contactRawPayloadParser (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:522:16)
at PuppetPadchat.<anonymous> (/Users/jiaruili/git/rui/wechaty/src/puppet/puppet.ts:494:35)
at Generator.next (<anonymous>)
at fulfilled (/Users/jiaruili/git/rui/wechaty/src/puppet/puppet.ts:4:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:74322) 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: 56)
{}
00:23:59 WARN PadchatRpc WXGetContact cannot get user_name, id: lizhuohuan, "{}"
00:23:59 ERR Contact ready() this.puppet.contactPayload(Contact) exception: cannot get user_name from raw payload: {}
(node:74322) UnhandledPromiseRejectionWarning: Error: cannot get user_name from raw payload: {}
at Object.contactRawPayloadParser (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/pure-function-helpers/contact-raw-payload-parser.ts:42:11)
at PuppetPadchat.<anonymous> (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:700:37)
at Generator.next (<anonymous>)
at /Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:25:71
at new Promise (<anonymous>)
at __awaiter (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:21:12)
at PuppetPadchat.contactRawPayloadParser (/Users/jiaruili/git/rui/wechaty/src/puppet-padchat/puppet-padchat.ts:522:16)
at PuppetPadchat.<anonymous> (/Users/jiaruili/git/rui/wechaty/src/puppet/puppet.ts:494:35)
at Generator.next (<anonymous>)
at fulfilled (/Users/jiaruili/git/rui/wechaty/src/puppet/puppet.ts:4:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:74322) 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: 58)
|
huan
added a commit
that referenced
this issue
Jun 25, 2018
lijiarui
added a commit
to lijiarui/wechaty
that referenced
this issue
Jun 25, 2018
Close this issue because it will continue discussing on its own repo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
6061139518@chatroom
is a Chatroom that the bot was invited into it before, but had been removed out later.The text was updated successfully, but these errors were encountered: