验证并记录 useStableAccessToken 配置行为 #3718
Draft
+0
−0
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.
问题描述
用户反馈在 4.7.0 版本中,配置
wx.miniapp.use-stable-access-token: true不生效,代码中获取的useStableAccessToken仍然是false。排查结果
通过全面测试和代码分析,确认该配置在当前版本(4.7.7.B)中工作正常。该问题应该已在 4.7.0 到 4.7.7.B 之间的版本中修复。
验证测试
创建了完整的测试应用程序进行验证:
配置链路工作正常:
WxMaProperties.useStableAccessTokenAbstractWxMaConfigStorageConfiguration通过properties.isUseStableAccessToken()读取配置config.useStableAccessToken(boolean)设置到配置对象BaseWxMaServiceImpl.getAccessToken()正确使用该设置选择对应的接口结论
当前版本无需代码修改,配置功能正常工作。遇到此问题的用户建议升级到 4.7.7.B 或更新版本。
测试确认了所有存储配置(Memory、Redis、Redisson)下,
true和false两个值的属性绑定都能正常工作。Fixes #3696
Fixes #3696
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.