Fix wrong region code uses#41
Conversation
|
I'm seeing that the resulting |
|
Thanks a lot for these @dulaccc ! This issue was discussed a little bit in #30. Basically, the one major check that Google's libPhoneNumber does that PhoneNumberKit doesn't is a type check. Unknown types are considered possible but invalid numbers. The issue is that in order to determine a phone number's type, MANY regular expressions are necessary (essentially comparing the number to every known type until there is a fit). This slows things down considerably and is not a behaviour I wanted to enable by default. I'll resolve this issue in the next release. |
|
Ok! Thank you for the very clear explanation. So my tests are not implemented correctly. I will keep on posting if I have unexpected behaviors in the coming weeks. |
Our number validator is getting some weird errors as we expand in other countries.
The numbers are validated on the phone, then if valid transmitted to our backend where an extra step of validation is run. And the backend step is triggering a lot of minor validation issues (mainly due to an incompatible combination between a valid number and a wrong region code).
So I've implemented some failing test for real usage cases that happened for us.
First step toward solving this and making this great project even more robust !
Cheers