-
-
Notifications
You must be signed in to change notification settings - Fork 9k
修复 WxCpRedisConfigImpl.getWebhookKey() 无限递归调用 #3821
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix infinite recursive calls in WxCpRedisConfigImpl
修复 WxCpRedisConfigImpl.getWebhookKey() 无限递归调用
Dec 24, 2025
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 修复了 WxCpRedisConfigImpl.getWebhookKey() 方法中的严重递归调用 bug,该方法错误地调用自身导致 StackOverflowError。修复方式是将递归调用改为直接返回实例变量,并添加了单元测试以验证修复有效性。
主要变更:
- 修复无限递归调用 bug,将
return this.getWebhookKey();改为return this.webhookKey; - 添加单元测试验证 getWebhookKey() 方法正确返回实例变量而非递归调用
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/config/impl/WxCpRedisConfigImpl.java | 修复 getWebhookKey() 方法的无限递归 bug,改为直接返回 webhookKey 字段 |
| weixin-java-cp/src/test/java/me/chanjar/weixin/cp/config/impl/WxCpRedisConfigImplTest.java | 新增单元测试验证 getWebhookKey() 方法的正确性,包括 null 值和反射设置值的测试场景 |
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/config/impl/WxCpRedisConfigImplTest.java
Outdated
Show resolved
Hide resolved
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/config/impl/WxCpRedisConfigImplTest.java
Outdated
Show resolved
Hide resolved
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/config/impl/WxCpRedisConfigImplTest.java
Outdated
Show resolved
Hide resolved
…WxCpRedisConfigImplTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…WxCpRedisConfigImplTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
修复 WxCpRedisConfigImpl 中的无限递归调用问题
问题描述
WxCpRedisConfigImpl类的getWebhookKey()方法存在无限递归调用,导致栈溢出错误。问题来源
该问题由提交
8e760a972ddbe9e79ca29d3b3d0499de36a293bf引入,该提交日期为 2025-12-22 09:37:25 +0800,提交信息为 ":art: #3654 【开放平台】消息路由处理程序增加对小程序的支持"。修复内容
WxCpRedisConfigImpl.getWebhookKey()方法,将return this.getWebhookKey();改为return this.webhookKey;WxCpRedisConfigImplTest验证修复,确保:验证结果
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.