Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Conversation

@danni-cool
Copy link
Owner

调整

  • 调整和优化了重复代码
  • 转发确实是附件类型,但是简单归为 combineforward 欠妥,假如是真实附件,因为特殊原因报错了,也可能进入这个逻辑,这个时候这里就不是combineforward了
  • 暂时将这个分支归到unknown类型里,好像就算展示了文本,也没啥用,但是解决了报错问题 👏 @Daydaylw3
  • web协议能力还是有限(日常吐槽)

Daydaylw3 and others added 4 commits May 15, 2024 19:04
原本收到合并消息转发的消息,会直接抛出错误,现在捕获这个错误并处理
原本收到合并消息转发的消息,会直接抛出错误,现在捕获这个错误并处理

```
[2024-05-15T17:46:41.442] [WARN] - 17:46:41 WARN message-parser Error occurred while parse message attachment: {"MsgId":"9077318394394722874","FromUserName":"@@XXXXXXXXXXX","ToUserName":"@xxxxxxxxxx","MsgType":49,"Content":"@xxxxxxxxxxxx:\n该类型暂不支持,请在手机上查看","Status":3,"ImgStatus":2,"CreateTime":1715766398,"VoiceLength":0,"PlayLength":0,"FileName":"","FileSize":"","MediaId":"","Url":"","AppMsgType":0,"StatusNotifyCode":0,"StatusNotifyUserName":"","RecommendInfo":{"UserName":"","NickName":"","QQNum":0,"Province":"","City":"","Content":"","Signature":"","Alias":"","Scene":0,"VerifyFlag":0,"AttrStatus":0,"Sex":0,"Ticket":"","OpCode":0},"ForwardFlag":0,"AppInfo":{"AppID":"","Type":0},"HasProductId":0,"Ticket":"","ImgHeight":0,"ImgWidth":0,"SubMsgType":0,"NewMsgId":9077318394394723000,"OriContent":"","EncryFileName":"","isSendBySelf":false,"OriginalContent":"@xxxxxxxxxxxx:<br/>该类型暂不支持,请在手机上查看"} , TypeError: Cannot read properties of undefined (reading 'msg')
    at parseAppmsgMessagePayload (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/messages/message-appmsg.js:34:76)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async appMsgParser (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/schema-mapper/message/message-parser-appmsg.js:36:28)
    at async executeMessageParsers (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/schema-mapper/message/message-parser.js:15:15)
    at async webMessageToWechaty (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/schema-mapper/message.js:70:5)
    at async PuppetWechat4u.messagePayload (/app/node_modules/.pnpm/[email protected][email protected]/node_modules/wechaty-puppet/dist/cjs/src/mixins/message-mixin.js:50:29)
    at async PuppetWechat4u.messageSearch (/app/node_modules/.pnpm/[email protected][email protected]/node_modules/wechaty-puppet/dist/cjs/src/mixins/message-mixin.js:67:21)
    at async WechatifiedMessageImpl.findAll (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/user-modules/message.js:98:35)
    at async WechatifiedMessageImpl.find (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/user-modules/message.js:81:29)
    at async PuppetWechat4u.<anonymous> (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/wechaty-mixins/puppet-mixin.js:240:45) 
[2024-05-15T17:46:41.443] [INFO] - Message: Message#Attachment[🗣Contact<ʚDayday🥱ɞ>@👥Room<🤖测试>] 
[2024-05-15T17:46:41.444] [ERROR] - 向 RECVD_MSG_API 上报 message 事件出错: Error: unsupported message. id: 9077318394394722874
    at PuppetWechat4u.messageFile (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/puppet-wechat4u.js:592:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async WechatifiedUserClass.toFileBox (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/user-modules/message.js:832:25)
    at async sendMsg2RecvdApi (/app/src/service/msgUploader.js:133:41)
    at async Object.onRecvdMessage (/app/src/service/msgSender.js:694:10)
```

如果 `const steamFile = msg.toFileBox ? await msg.toFileBox() :
msg.content()` 这里没有抛出错误,则流程和以前一样
@danni-cool danni-cool changed the base branch from main to feat-2.10.0 May 16, 2024 10:11
@danni-cool danni-cool merged commit 7427a2c into feat-2.10.0 May 16, 2024
@danni-cool danni-cool deleted the dev branch May 16, 2024 10:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants