-
Notifications
You must be signed in to change notification settings - Fork 62
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
Update PhoneNumberMetadata #43
Comments
TasksAdd method
|
I've been running some tests and noticed an area code that was recently introduced in Alberta, Canada, that would fail the iex(33)> {:ok, parsed} = ExPhoneNumber.parse("368.551.0368", "CA")
{:ok,
%ExPhoneNumber.Model.PhoneNumber{
country_code: 1,
country_code_source: nil,
extension: nil,
italian_leading_zero: nil,
national_number: 3685510368,
number_of_leading_zeros: nil,
preferred_domestic_carrier_code: nil,
raw_input: nil
}} (fails with This js port validates the previous number properly (see sandbox) OP stated:
My question: why are all methods listed above needed in order to get the metadata up-to-date? And would that mean that |
Because they are needed to handle the newer metadata.
Yes, although it isn't broken, just outdated. You could build the current iex(1)> {:ok, parsed} = ExPhoneNumber.parse("368.551.0368", "CA")
{:ok,
%ExPhoneNumber.Model.PhoneNumber{
country_code: 1,
country_code_source: nil,
extension: nil,
italian_leading_zero: nil,
national_number: 3685510368,
number_of_leading_zeros: nil,
preferred_domestic_carrier_code: nil,
raw_input: nil
}}
iex(2)> ExPhoneNumber.is_valid_number?(parsed)
true As the metadata changes every 2-3 weeks, it is very likely that you will find a phone number that does not pass the validation even if it is "real". See Falsehoods About Phone Numbers. |
Thanks for the quick reply. Just wondering, in general, what is the delay for mirroring official libphonenumber, as the client implementation I'm using of libphonenumber accepts certain numbers that ex_phone_number doesn't. Nevertheless respect, kudos and many thanks for developing, open-sourcing and maintaining this library. 🤜 |
https://github.com/socialpaymentsbv/ex_phone_number/blob/master/README.md states the currently used metadata version. This should give you enough information to see the delay. |
Nothing in particular, I haven't had enough time, pending changes have accumulated and the code is complex in some parts, although the latter is the result of following the upstream project since this is almost a function by function port. |
When are you planning to release new version? |
There is no release date set. As you can see the work was started many months ago and might be considered slow, but it is steady moving forward thanks to @josemrb and recently also @tomciopp. I think that – because of to the clear plan laid out above by Jose – others might also join this effort.
I think that |
Thanks @szymon-jez for your reply. |
I join here the conversation: Thanks |
Refs #42, #39, #33
Problem
The library uses outdated metadata. Therefore it is not validating/formatting some numbers right.
Solution
To upgrade the metadata it is also necessary to upgrade the code.
The text was updated successfully, but these errors were encountered: