We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
接收小程序媒体检测回调消息时,进入方法cn.binarywang.wx.miniapp.message.WxMaMessageRouter#isMsgDuplicated判断消息是否重复
private boolean isMsgDuplicated(WxMaMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime()) .append("-").append(wxMessage.getFromUser()) .append("-").append(StringUtils.trimToEmpty(wxMessage.getEvent())); } else { messageId.append(wxMessage.getMsgId()) .append("-").append(wxMessage.getCreateTime()) .append("-").append(wxMessage.getFromUser()); } if (StringUtils.isNotEmpty(wxMessage.getToUser())) { messageId.append("-").append(wxMessage.getToUser()); } return this.messageDuplicateChecker.isDuplicate(messageId.toString()); }
以下是同一个小程序、同一时间发起的2条媒体检测,解密后的回调数据:
{"ToUserName":"xx","FromUserName":"xx","CreateTime":1655747827,"MsgType":"event","Event":"wxa_media_check","isrisky":"0","extra_info_json":"","appid":"xx","trace_id":"db6a6eb16fd1c8afe425b1c76917cc0c","status_code":"0"} {"ToUserName":"xx","FromUserName":"xx","CreateTime":1655747827,"MsgType":"event","Event":"wxa_media_check","isrisky":"0","extra_info_json":"","appid":"xx","trace_id":"fbef75edb40bd0b95ea0d138ca6d71f8","status_code":"0"}
只有trace_id不同,可见这种情况下根据CreateTime及ToUserName不足以作为唯一条件,导致消息丢失
The text was updated successfully, but these errors were encountered:
顺带提一嘴,me.chanjar.weixin.common.api.WxConsts.EventType枚举少了wxa_media_check事件类型
Sorry, something went wrong.
欢迎直接提交PR修复代码,非常期待
🎨 #2705 【小程序】异步安全校验事件中消息重复判断代码修复
3ee7d0d
🎨 binarywang#2705 【小程序】异步安全校验事件中消息重复判断代码修复
a3cff27
No branches or pull requests
简要描述
接收小程序媒体检测回调消息时,进入方法cn.binarywang.wx.miniapp.message.WxMaMessageRouter#isMsgDuplicated判断消息是否重复
以下是同一个小程序、同一时间发起的2条媒体检测,解密后的回调数据:
只有trace_id不同,可见这种情况下根据CreateTime及ToUserName不足以作为唯一条件,导致消息丢失
模块版本情况
The text was updated successfully, but these errors were encountered: