Skip to content

Normalize mobile login numbers, skip completion flow for session-only account tests, and add tests#72

Merged
CJackHwang merged 1 commit intodevfrom
codex/review-changes-to-test-account-logic
Mar 2, 2026
Merged

Normalize mobile login numbers, skip completion flow for session-only account tests, and add tests#72
CJackHwang merged 1 commit intodevfrom
codex/review-changes-to-test-account-logic

Conversation

@CJackHwang
Copy link
Owner

Motivation

  • Ensure mobile numbers are normalized for login requests and area code handling is correct.
  • Avoid performing full completion calls when the admin account test is invoked in session-only mode (empty message), to reduce unnecessary network calls.

Description

  • Added normalizeMobileForLogin in internal/deepseek/client_auth.go to strip non-digit characters and normalize +86/86 Chinese mobile prefixes before sending login payloads and wire the returned area_code into the login payload.
  • Changed Login payload construction to use normalizeMobileForLogin and include area_code appropriately.
  • Updated testAccount in internal/admin/handler_accounts_testing.go to short-circuit and mark the test as successful when message is empty (session-only test), avoiding GetPow/CallCompletion calls and returning a clear message API 测试成功(仅会话创建).
  • Added unit tests: internal/deepseek/client_auth_mobile_test.go to verify mobile normalization behavior and internal/admin/handler_accounts_testing_test.go to verify session-only account testing only creates a session, refreshes token, persists status, and does not call completion-related flows.

Testing

  • Ran the new admin test with go test ./internal/admin -run TestTestAccount_BatchModeOnlyCreatesSession, which passed.
  • Ran the deepseek tests with go test ./internal/deepseek -run TestNormalizeMobileForLogin_*, which passed.

Codex Task

@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment Mar 2, 2026 3:49pm

Repository owner deleted a comment from chatgpt-codex-connector bot Mar 2, 2026
@CJackHwang CJackHwang added codex and removed codex labels Mar 2, 2026
@CJackHwang CJackHwang merged commit c329bf2 into dev Mar 2, 2026
3 checks passed
@CJackHwang CJackHwang deleted the codex/review-changes-to-test-account-logic branch March 2, 2026 15:56
CJackHwang added a commit that referenced this pull request Mar 2, 2026
Merge pull request #72 from CJackHwang/codex/review-changes-to-test-account-logic

Normalize mobile login numbers, skip completion flow for session-only account tests, and add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant