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

Conversation

@Daydaylw3
Copy link
Contributor

原本收到合并消息转发的消息,会直接抛出错误,现在捕获这个错误并处理

[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
Copy link
Owner

@Daydaylw3 感谢你的pr,稍后会进入测试和发布

@danni-cool danni-cool changed the base branch from main to dev May 15, 2024 13:34
@danni-cool danni-cool merged commit 4e6dbf0 into danni-cool:dev May 15, 2024
@Daydaylw3 Daydaylw3 deleted the combineforward branch May 15, 2024 14:34
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.

2 participants