Repository navigation
[Payment due @Ollyws] Upgrade awesome-phonenumber to 6.11.0 so newer US area codes like 983 validate - #104372
[Payment due @Ollyws] Upgrade awesome-phonenumber to 6.11.0 so newer US area codes like 983 validate#104372MelvinBot wants to merge 4 commits into
Conversation
|
I fixed the
|
|
I merged main into this branch in 6829ec3 to fix the
|
… validate Co-authored-by: Issa Nimaga <[email protected]>
Co-authored-by: Issa Nimaga <[email protected]>
…Phonenumber Co-authored-by: Issa Nimaga <[email protected]>
6829ec3 to
34ee787
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🚧 inimaga has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Bump @Ollyws |
|
@inimaga |
|
@Ollyws I've updated the steps to specify using a US address. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp01_Android_Native.mp4Android: mWeb Chrome02_Android_Chrome.mp4iOS: HybridApp03_iOS_Native.mp4iOS: mWeb Safari04_iOS_Safari.mp4MacOS: Chrome / Safari05_MacOS_Chrome.mp4 |
I think |
|
🎯 @Ollyws, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
@NicolasBonet Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Explanation of Change
Users with phone numbers in newer US area codes, such as 983 (Colorado), can't save them in Wallet or Profile > Personal details. The App rejects the number in the browser before sending any request.
Why:
awesome-phonenumber5.4.0 bundles libphonenumber 8.13.9 (April 2023). Its metadata doesn't include 983, soparsePhoneNumberreturnspossible: false. BothisValidPhoneNumberandisValidUSPhonedepend onpossible.What this PR changes:
awesome-phonenumberfrom^5.4.0to exactly6.11.0, which bundles libphonenumber 8.13.43. The 983 exchanges first validate in 8.13.30.expensify-commonuses the same copy. Without it, npm installs a nested 5.4.0 forexpensify-common, soStr.isValidPhoneNumberkeeps the old metadata and doesn't get the worklet patch.git applyapplies it cleanly to a fresh 6.11.0 install.Why the version is pinned to 6.11.0: 6.11.1 reverted upstream's change that marks invalid numbers as
possible: false(grantila/awesome-phonenumber#103). On 6.11.1 and later,possiblechecks only length, so+11234567890would passisValidPhoneNumber. 6.11.0 is the newest release that keeps today's strict behavior. A caret range would let a future lockfile update pick 6.12.0, so the version is exact.Results from Jest, comparing the current version with this PR:
main)+19833330123+1-(983)-333-0123+12018675309+11234567890(invalid area code)+115005550009(App's custom rule)AI Tests
The runner had Node 24.19.0, not the required 26.5.0, and Bun's postinstall couldn't run.
PhoneNumberTest,LoginUtilsTest,LocalePhoneNumberTest,useHasPhoneNumberTest, anduseWalletPhoneMagicCodeTest(68 tests). A temporary Jest test produced the table above on 5.4.0 and 6.11.0 by callingisValidPhoneNumber,isValidUSPhone, and the raw library.npm run spell-changed,scripts/validatePatches.shchecks (the patch is referenced indetails.md), andgit applyof the ported patch against a clean 6.11.0 install.ValidationUtilsTest,UserUtilsTest,PersonalDetailsUtilsTest,OptionsListUtilsTest, andSuggestionMentionTest. Each fails withMust use import to load ES Module: @react-navigation/corebecause of Node 24, before any test runs. CI on Node 26 will run them, including the new tests.npm run lint,npm run typecheck,oxfmt, andscripts/applyPatches.ts.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/689351
PROPOSAL: N/A
Tests
Automated tests
Covered by added/updated automated tests
Manual tests
9833330123.+19833330123and+1-(983)-333-0123; verify both formats are accepted.+11234567890; verify an invalid-phone-number error blocks progress.Upgrade.number.test.mp4
Offline tests
N/A
QA Steps
Same as manual test steps above.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Upgrade.number.test.mp4