Skip to content
New issue

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

【BUG】客户标签回调函数-重排事件报错 #3116

Open
laboratory9173 opened this issue Feb 17, 2025 · 1 comment
Open

【BUG】客户标签回调函数-重排事件报错 #3116

laboratory9173 opened this issue Feb 17, 2025 · 1 comment
Labels
resolved 已解决

Comments

@laboratory9173
Copy link

此版块专为反馈 bug 及提交需求服务,不负责解答开发问题,请勿发表开发问题,
如果您需要这方面的帮助,请移步问答社区https://weixin.senparc.com/QA

问题描述

客户标签事件回调-重排事件报错

重现问题步骤(如果可以)
  1. 登录到企微后台管理-客户与上下游-企业客户标签-客户联系
  2. 对已有的客户标签进行重新排序
  3. 触发重排回调函数会报错
    已经找出问题所在
// 代码位置:Senparc.Weixin.WorkWeiXinMPSDK/src/Senparc.Weixin.Work/Senparc.Weixin.Work/MessageContext/DefaultWorkMessageContext.cs
// DefaultWorkMessageContext.cs Line 207
 var tagType = doc.Root.Element("TagType").Value; // 这个地方回调函数传入的 xml ,不存在元素 TagType,此时返回 null,再调取 Value 会报错

应改为

 var tagType = doc.Root.Element("TagType")?.Value; 
微信官方文档 URL

https://developer.work.weixin.qq.com/document/path/92130#%E4%BC%81%E4%B8%9A%E5%AE%A2%E6%88%B7%E6%A0%87%E7%AD%BE%E9%87%8D%E6%8E%92%E4%BA%8B%E4%BB%B6

微信官方文档快照(直接复制关键内容到下方)
<xml>
	<ToUserName><![CDATA[CORPID]]></ToUserName>
	<FromUserName><![CDATA[sys]]></FromUserName> 
	<CreateTime>1403610513</CreateTime>
	<MsgType><![CDATA[event]]></MsgType>
	<Event><![CDATA[change_external_tag]]></Event>
	<Id><![CDATA[TAG_ID]]></Id>
	<StrategyId><![CDATA[STRATEGY_ID]]></StrategyId>
	<ChangeType><![CDATA[shuffle]]></ChangeType>
</xml>
发现问题的模块
  • Senparc.Weixin 版本:
模块对应的 .net 版本
  • .net 8
开发环境
  • Visual Studio 2022
缓存环境
  • 服务器内存缓存
系统环境
  • Windows,版本
联系方式

Email:xiangjianmin@aliyuin.com

(也可将问题地址及联系方式发送到 www.jeffrey.su@gmail.com)

发布问题后,请保持对 issue 的关注,有时会有需要进一步沟通的信息,很长时间内没有得到答复的 issue 将被关闭。

@JeffreySu
Copy link
Owner

@laboratory9173 已修复,发布 Worrk v3.25.5,非常感谢!

ba7f319

@JeffreySu JeffreySu added the resolved 已解决 label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved 已解决
Projects
None yet
Development

No branches or pull requests

2 participants