Skip to content
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

Fix: Correctly identify Chinese mobile numbers #5802

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glzjin
Copy link

@glzjin glzjin commented Apr 28, 2024

Summary

Correctly identify Chinese mobile numbers to prevent US mobile numbers from being classified as Chinese mobile numbers.

Testing

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

…umbers from being classified as Chinese mobile numbers.
Copy link

COMPARE TO master

Total Size Diff 📉 -1 Bytes

Diff by File
Name Diff
packages/connectors/connector-aliyun-sms/src/index.ts 📉 -1 Bytes

@@ -20,7 +20,7 @@ import { sendSms } from './single-send-text.js';
import type { Template } from './types.js';
import { aliyunSmsConfigGuard, sendSmsResponseGuard } from './types.js';

const isChinaNumber = (to: string) => /^(\+86|0086|86)?\d{11}$/.test(to);
const isChinaNumber = (to: string) => /^(\+86|0086|86)\d{11}$/.test(to);
Copy link
Member

Choose a reason for hiding this comment

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

@logto-io/eng can you guys take a look?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

But the existing data may not have country code prefix, hold this PR until we have a plan for migration.

Copy link

This PR is stale because it has been open 10 for days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label May 14, 2024
@wangsijie
Copy link
Contributor

Hi @glzjin, after discussion, we think it is better to provider a switch config, to let the user to decide how to treat the numbers without country code.

Would you mind adding a config in the "formItems"?

@github-actions github-actions bot removed the stale label May 18, 2024
Copy link

github-actions bot commented Jun 1, 2024

This PR is stale because it has been open 10 for days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants