cs-magic / codebase-ts

CS Magic Codebase (TS)
3 stars 0 forks source link

修复 web 版协议账号挂掉 #24

Closed MarkShawn2020 closed 6 months ago

MarkShawn2020 commented 6 months ago

导致挂掉的一些问题

MarkShawn2020 commented 6 months ago

todo: wechat4u 不支持获取 topic of room-invitation

[14:36:46.615] INFO (default/1634243): onRoomInvite Error: Wechaty Puppet Unsupported API Error. Learn More At https://github.com/wechaty/wechaty-puppet/wiki/Compatibility at Module.throwUnsupportedError (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet/src/throw-unsupported-error.ts:4:9) at PuppetWechat4u.roomInvitationRawPayload (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:872:19) at PuppetWechat4u.roomInvitationPayload (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet/src/mixins/room-invitation-mixin.ts:92:37) at WechatifiedUserClass.topic (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/src/user-modules/room-invitation.ts:165:47) at handleRoomInvite (/home/ubuntu/@cs-magic/coding/codebase/packages-core/wechaty/handlers/handle-room-invite.ts:20:42) at WechatyImpl. (/home/ubuntu/@cs-magic/coding/codebase/packages-core/wechaty/handlers/index.ts:46:13) at WechatyImpl.emit (node:events:514:28) at WechatyImpl.emit (node:domain:489:12) at WechatyImpl.emit (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22) at PuppetWechat4u. (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:327:20) at PuppetWechat4u.emit (node:events:514:28) at PuppetWechat4u.emit (node:domain:489:12) at PuppetWechat4u.emit (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet/src/puppet/puppet-skeleton.ts:117:20) at Wechat. (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:432:16) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [14:36:46.615] INFO (default/1634243): roomId: "7002221024767979545"

MarkShawn2020 commented 6 months ago

invitee

[00:29:03.587] DEBUG (default/1216484): . [00:29:10.109] ERROR (default/1216484): query must provide at least one key. current query is empty. 00:29:10 ERR Contact this.wechaty.puppet.contactFindAll() rejected: query must provide at least one key. current query is empty. [00:29:10.109] ERROR (default/1216484): query must provide at least one key. current query is empty. [00:29:10.119] INFO (default/1216484): invitees has self: false Error: Wechaty Puppet Unsupported API Error. Learn More At https://github.com/wechaty/wechaty-puppet/wiki/Compatibility at Module.throwUnsupportedError (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet/src/throw-unsupported-error.ts:4:9) at PuppetWechat4u.roomAnnounce (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/node_modules/wechaty-puppet-wechat4u/src/puppet-wechat4u.ts:994:19) at WechatifiedUserClass.announce (/home/ubuntu/@cs-magic/coding/codebase/node_modules/wechaty/src/user-modules/room.ts:863:54) at handleRoomJoin (/home/ubuntu/@cs-magic/coding/codebase/packages-core/wechaty/handlers/handle-room-join.ts:42:33) at WechatyImpl. (/home/ubuntu/@cs-magic/coding/codebase/packages-core/wechaty/handlers/index.ts:58:7) 2

目前测试没下来,不会挂掉,只会报 error:

11:30:16 ERR Contact this.wechaty.puppet.contactFindAll() rejected: query must provide at least one key. current query is empty. [11:30:16.064] ERROR (default/1501335): query must provide at least one key. current query is empty. [11:30:16.064] ERROR (default/1501335): query must provide at least one key. current query is empty. [11:30:16.065] ERROR (default/1501335): no inviter found for id: undefined [11:30:16.065] ERROR (default/1501335): no inviter found for id: undefined [11:30:29.256] DEBUG (default/1501335): .

MarkShawn2020 commented 6 months ago

通过加入error-handler,确保所有函数都不会挂