GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 修复企业微信群聊变更事件MemChangeList字段命名规范问题 by Copilot · Pull Request #3827 · binarywang/WxJava

Conversation

Copilot AI commented Jan 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

问题

4.7.9.B版本中企业微信群聊变更事件的MemChangeList字段解析异常,显示为空字符串。根因是WxCpXmlMessage类中字段名MemChangeList首字母大写,违反Java命名规范。

修改内容

核心修复

  • 字段名从MemChangeList改为memChangeList(保持@XStreamAlias("MemChangeList")不变)

测试覆盖

  • 新增testExternalChatChangeEvent测试方法
  • 覆盖成员加入、退出及无成员变更三种场景

示例

// 群成员变更事件XML解析
String xml = "<xml>"
    + "<Event><![CDATA[change_external_chat]]></Event>"
    + "<ChangeType><![CDATA[update]]></ChangeType>"
    + "<MemChangeCnt>2</MemChangeCnt>"
    + "<MemChangeList><![CDATA[user1,user2]]></MemChangeList>"
    + "</xml>";

WxCpXmlMessage message = WxCpXmlMessage.fromXml(xml);
String members = message.getMemChangeList(); // 现在正确返回 "user1,user2"

相关文档: 企业微信客户群变更回调

Original prompt

This section details on the original issue you should resolve

<issue_title>更新到4.7.9.B版本,在企业微信群聊变更时,MemChangeList字符串是空字符串</issue_title>
<issue_description>

简要描述

更新到4.7.9.B版本,在企业微信群聊变更时,MemChangeList字符串是空字符串,如果是4.7.0版本,没有MemChangeList字段

模块版本情况

  • WxJava 模块名: weixin-java-cp
  • WxJava 版本号:4.7.9.B

详细描述

更新到4.7.9.B版本,在企业微信群聊变更时或者成员加入和退出时,微信回调的MemChangeList字符串是空字符串

</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程

  • Fixes 更新到4.7.9.B版本,在企业微信群聊变更时,MemChangeList字符串是空字符串 #3826

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Initial plan
e5a15dc
Copilot AI assigned Copilot and binarywang Jan 3, 2026
Copilot started work on behalf of binarywang January 3, 2026 06:51
View session
@binarywang
修复企业微信群聊变更事件MemChangeList字段命名问题并添加测试
2c2b06e
Co-authored-by: binarywang <[email protected]>
Copilot AI changed the title [WIP] Fix empty MemChangeList string in group chat updates 修复企业微信群聊变更事件MemChangeList字段命名规范问题 Jan 3, 2026
Copilot AI requested a review from binarywang January 3, 2026 07:04
Copilot finished work on behalf of binarywang January 3, 2026 07:04
@binarywang
binarywang marked this pull request as ready for review January 3, 2026 07:06
Copilot AI review requested due to automatic review settings January 3, 2026 07:06
Copilot started reviewing on behalf of binarywang January 3, 2026 07:06
View session
Copilot AI reviewed Jan 3, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本PR修复了企业微信群聊变更事件中MemChangeList字段因命名不规范导致的解析异常问题。在4.7.9.B版本中,该字段显示为空字符串,原因是字段名首字母大写违反了Java命名规范。

关键修改:

  • 将WxCpXmlMessage类中的字段名从MemChangeList改为memChangeList,符合Java驼峰命名规范
  • 保持@XStreamAlias("MemChangeList")注解不变,确保XML解析正确
  • 新增完整的测试用例,覆盖成员加入、退出及无成员变更三种场景

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java 修复字段命名:将MemChangeList改为memChangeList,符合Java命名规范,同时保持XML别名注解不变
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java 新增testExternalChatChangeEvent测试方法,全面测试群聊成员变更事件的三种场景(加入、退出、无变更)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@binarywang
binarywang merged commit 7c6dbf1 into develop Jan 3, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@binarywang
binarywang deleted the copilot/fix-empty-memchangelist branch January 3, 2026 08:45
@binarywang binarywang added this to the 4.8.0 milestone Jan 3, 2026
@zhouHongGui

zhouHongGui commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

这个问题没有解决,将切换至4.8.0和4.8.1.B这两个版本测试,都是空字符串,包含退群和加群的时候,这个变更成员的字段都是空字符串
log.debug("解密后的原始xml消息内容:{}", plainText)
<xml><ToUserName><![CDATA[c2e112dad808119117371bbcd6]]></ToUserName><FromUserName><![CDATA[sys]]></FromUserName><CreateTime>9811170016713</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[change_external_chat]]></Event><ChatId><![CDATA[wrxUBwDQAAa44T11Ziaed811rhUr8-3Igmug]]></ChatId><ChangeType><![CDATA[update]]></ChangeType><UpdateDetail><![CDATA[add_member]]></UpdateDetail><JoinScene>3</JoinScene><MemChangeCnt>1</MemChangeCnt><MemChangeList><Item><![CDATA[wmxUBwDQAAO-Hn5_wFJz4wvo5TxLFibw]]></Item></MemChangeList><LastMemVer><![CDATA[5807afd2ab75771d5e8ac623f534ac0b]]></LastMemVer><CurMemVer><![CDATA[ea36e8b6062b803cda0ee45e9418d637]]></CurMemVer></xml>

QQ20260202-144702
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@binarywang binarywang mentioned this pull request Mar 6, 2026
退群和加群的时候,变更成员的字段都是空字符串 #3904
Closed
Copilot AI mentioned this pull request Mar 6, 2026
Fix memChangeList always empty in change_external_chat events #3905
Closed
@binarywang

binarywang commented Mar 6, 2026

Copy link
Copy Markdown
Owner

这个问题没有解决,将切换至4.8.0和4.8.1.B这两个版本测试,都是空字符串,包含退群和加群的时候,这个变更成员的字段都是空字符串 log.debug("解密后的原始xml消息内容:{}", plainText) <xml><ToUserName><![CDATA[c2e112dad808119117371bbcd6]]></ToUserName><FromUserName><![CDATA[sys]]></FromUserName><CreateTime>9811170016713</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[change_external_chat]]></Event><ChatId><![CDATA[wrxUBwDQAAa44T11Ziaed811rhUr8-3Igmug]]></ChatId><ChangeType><![CDATA[update]]></ChangeType><UpdateDetail><![CDATA[add_member]]></UpdateDetail><JoinScene>3</JoinScene><MemChangeCnt>1</MemChangeCnt><MemChangeList><Item><![CDATA[wmxUBwDQAAO-Hn5_wFJz4wvo5TxLFibw]]></Item></MemChangeList><LastMemVer><![CDATA[5807afd2ab75771d5e8ac623f534ac0b]]></LastMemVer><CurMemVer><![CDATA[ea36e8b6062b803cda0ee45e9418d637]]></CurMemVer></xml>

QQ20260202-144702

你有何修复建议,欢迎直接提交PR代码吧,谢谢

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@binarywang binarywang Awaiting requested review from binarywang

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@binarywang binarywang

Copilot code review Copilot

Labels

None yet

Projects

None yet

Milestone

4.8.0

Development

Successfully merging this pull request may close these issues.

更新到4.7.9.B版本,在企业微信群聊变更时,MemChangeList字符串是空字符串

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@zhouHongGui @binarywang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.