Skip to content

fix(verification): 验证码提取保留原文大小写 - #103

Merged
cursor[bot] merged 1 commit into
mainfrom
devin/1783258881-fix-verification-code-case
Jul 18, 2026
Merged

fix(verification): 验证码提取保留原文大小写#103
cursor[bot] merged 1 commit into
mainfrom
devin/1783258881-fix-verification-code-case

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Pull request type / PR 类型

  • Bugfix / Bug 修复

What is the current behavior? / 当前行为是什么?

验证码提取收口时对提取结果强制 .upper(),导致含字母的验证码大小写被篡改。例如邮件正文验证码为 ab12cd,接口返回 AB12CDverification_codeformatted 都被改)。

链路:get_verification_result_run_generic_verification_extractextract_verification_info_with_optionsenhance_verification_with_ai_fallback

Issue Number / Issue 编号: N/A

What is the new behavior? / 新行为是什么?

outlook_web/services/verification_extractor.py 移除验证码取值处的强制大写,保留邮件原文大小写:

  • _smart_extract_code_by_keywordsreturn value.upper()return value
  • _fallback_extract_codecandidates.append(value.upper())append(value)
  • 历史函数 smart_extract_verification_codereturn match.upper()return match
  • 历史函数 fallback_extract_verification_codefiltered.append(match.upper())append(match)(过滤判断仍基于原值,逻辑不变)
  • AI 回退 enhance_verification_with_ai_fallbackresult["verification_code"] = ai_code.upper()= ai_code

formattedverification_code 重算,因此同步保持原大小写。

仅改大小写取值,不改动匹配范围/置信度/互斥等其它逻辑(其余 .upper() 如 HTTP method、错误码分类均保持不变)。

补充回归测试:

  • tests/test_verification_extractor.py:规则分支小写 / 大小写混合(ab12cdAb12Cd)保持原样,且 formatted 一致
  • tests/test_ai_fallback_trigger_condition.py:AI 回退返回 cbdfdb 时保持小写

本地验证:新增及相关用例全部通过;black / isort / flake8(E9,F63,F7,F82) 均通过。

Release notes / 发布日志

已在 CHANGELOG.md[Unreleased] / 修复 中记录:验证码提取保留原文大小写。

Other information / 其他信息

无。

Link to Devin session: https://app.devin.ai/sessions/f4c5628e21d4407e9b9133c97851be53
Requested by: @ZeroPointSix

规则分支与 AI 回退不再强制 .upper(),verification_code 与 formatted
保持邮件原文大小写;补充回归测试。

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ZeroPointSix ZeroPointSix self-assigned this Jul 5, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Copy link
Copy Markdown
Owner

Migration note: the applicable changes from this PR have been ported into #112, targeting the #109 SPA migration branch.

#112 includes the registration mail pool API/docs/backend pieces and related validation. Full validation details are in the new PR body.

Copy link
Copy Markdown
Owner

已将本 PR 纳入 issue #115 的旧前端紧急版本专用合并分支:#117 #117

该分支仅汇总旧前端优先修复,目前包含 #67/#103/#108,明确不包含 #109/#110/#111/#112 新前端/SPA 线。远端沙箱验证已通过:focused regression 138 tests OK,full python -m unittest discover -s tests -v exit 0。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant