wechaty / puppet-wechat4u

Wechat4u Puppet for Wechaty
https://www.npmjs.com/package/wechaty-puppet-wechat4u
Apache License 2.0
99 stars 34 forks source link

启动后,发现两个未捕获异常 #56

Open sinajia opened 1 year ago

sinajia commented 1 year ago
2023-04-26 11:56: GError: query must provide at least one key. current query is empty.
2023-04-26 11:56:     at PuppetWechat4u.contactQueryFilterFactory (file:///yj/prj/wechatbot/node_modules/wechaty-puppet/dist/esm/src/mixins/contact-mixin.js:117:23)
2023-04-26 11:56:     at PuppetWechat4u.contactSearch (file:///yj/prj/wechatbot/node_modules/wechaty-puppet/dist/esm/src/mixins/contact-mixin.js:64:41)
2023-04-26 11:56:     at async Function.findAll (file:///yj/prj/wechatbot/node_modules/wechaty/dist/esm/src/user-modules/contact.js:129:35)
2023-04-26 11:56:     at async Function.find (file:///yj/prj/wechatbot/node_modules/wechaty/dist/esm/src/user-modules/contact.js:84:29)
2023-04-26 11:56:     at async Promise.all (index 0)
2023-04-26 11:56:     at async PuppetWechat4u.<anonymous> (file:///yj/prj/wechatbot/node_modules/wechaty/dist/esm/src/wechaty-mixins/puppet-mixin.js:273:56) {
2023-04-26 11:56:   code: 2,
2023-04-26 14:10: AssertionError [ERR_ASSERTION]: 1205 == 0
2023-04-26 14:10:     at Object.equal (/yj/prj/wechatbot/node_modules/wechat4u/lib/util/global.js:69:24)
2023-04-26 14:10:     at /yj/prj/wechatbot/node_modules/wechat4u/lib/core.js:324:24
2023-04-26 14:10:     at runMicrotasks (<anonymous>)
2023-04-26 14:10:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-04-26 14:10:     at async Promise.all (index 0) {
2023-04-26 14:10:   code: 2,
2023-04-26 14:10:   details: 'AssertionError [ERR_ASSERTION]: 1205 == 0\n' +
2023-04-26 14:10:     '    at Object.equal (/yj/prj/wechatbot/node_modules/wechat4u/lib/util/global.js:69:24)\n' +
2023-04-26 14:10:     '    at /yj/prj/wechatbot/node_modules/wechat4u/lib/core.js:324:24\n' +
2023-04-26 14:10:     '    at runMicrotasks (<anonymous>)\n' +
2023-04-26 14:10:     '    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +
2023-04-26 14:10:     '    at async Promise.all (index 0)'
2023-04-26 14:10: }
bestK commented 1 year ago

我也遇到了

2023-04-26 11:56: GError: query must provide at least one key. current query is empty.

测试发现当触发 room-jon 事件时必现,debug 跟踪到 image

this.emit('room-join', room, inviteeList, inviter, date);

这行代码执行完没有问题,而自己定义的 room-jon 只有 3 个参数

 .on('room-join', async (room, inviteeList, inviter,// 这里少了个 date) => {
    console.log('received room-join event ');
  })

修改成

 .on('room-join', async (room, inviteeList, inviter, date) => {
    console.log('received room-join event ');
  })

image