Skip to content

Fix: The isMobilePhone validator incorrectly rejects valid Uzbeki#2705

Closed
Sagar-024 wants to merge 1 commit into
validatorjs:masterfrom
Sagar-024:repatch/fix-1778424071511
Closed

Fix: The isMobilePhone validator incorrectly rejects valid Uzbeki#2705
Sagar-024 wants to merge 1 commit into
validatorjs:masterfrom
Sagar-024:repatch/fix-1778424071511

Conversation

@Sagar-024
Copy link
Copy Markdown

Root Cause Analysis

The bug is in the phone number validation regex for Uzbekistan's locale. Uzbekistan mobile numbers starting with +998 typically use prefixes like 90, 91, 93, 94, 95, 97, 98, 99, but the 77 prefix was later added for new number ranges. The current regex pattern doesn't include '77' as a valid carrier code, causing valid numbers like +998771234567 to be incorrectly rejected. The fix would involve updating the regex pattern for the 'uz-UZ' locale in the isMobilePhone source code to include the 77 prefix alongside existing ones.

Proof of Bug

The following reproduction test was executed in a sandboxed environment and failed as expected, confirming the reported issue:

The Fix

Applied surgical code changes to address the root cause.

Proof of Fix

After applying the surgical patch, the reproduction test and the project's test suite were executed. All tests passed successfully:


Generated by Repatch — Autonomous Test-Driven Debugging

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7fdc788) to head (4278f07).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2705   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2587      2587           
  Branches       656       656           
=========================================
  Hits          2587      2587           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Sagar-024 Sagar-024 closed this May 10, 2026
@Sagar-024 Sagar-024 deleted the repatch/fix-1778424071511 branch May 10, 2026 15:02
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