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

cell_phone_in_e164 returning super long phone number... #2047

Closed
Aryk opened this issue Jun 10, 2020 · 7 comments · Fixed by #2842
Closed

cell_phone_in_e164 returning super long phone number... #2047

Aryk opened this issue Jun 10, 2020 · 7 comments · Fixed by #2842
Assignees

Comments

@Aryk
Copy link

Aryk commented Jun 10, 2020

I'm getting "+186813608500740" as a result from

Faker::PhoneNumber.cell_phone_in_e164

I'm using the phonelib library to parse this number and it cannot extract any information from it.

It does not look like a valid phone number where I can parse and extra a country code from it.

Was this intended?

@danielTiringer
Copy link
Contributor

It appears that Faker generates a phone number that, in format, could potentially be a valid (or possible) phone number. It doesn't mean it actually is.
Compared to that, phonelib actually evaluates the number, and looks at country / area specifics.

For instance, Faker generated (using the cell_phone_with_country_code method) ' +36 546.171.0042. Based on the country code (HU), there should be 8 or 9 characters following, 11 is too much. Phonelib will catch this, but Faker doesn't go that deep into the details.

@Drowze
Copy link

Drowze commented Jan 6, 2022

Also facing this issue, got +144117229214047 from Faker::PhoneNumber.cell_phone_in_e164 (which blew on a validation we have later on).

@Aryk
Copy link
Author

Aryk commented Jan 6, 2022

I tend to think this library should be more dependable and only generate phone numbers that will get parsed as being valid. In other words, should be either completely valid or completed not valid (just a string of numbers even without a real country code bc what's the point to have correct country codes if it doesn't parse correctly?)

@stefannibrasil
Copy link
Contributor

Hey, folks. In an effort to lighten our load as maintainers and be able to serve you better in the future, the faker-ruby team is working on cleaning out the cobwebs in this repo by pruning the backlog. As there are few of us, there are a lot of items that will simply never earn our attention in a reasonable time frame, and rather than giving you an empty promise, we think it makes more sense to focus on more recent issues. That means, unfortunately, that we must close this issue.

Don't take this the wrong way: our aim is not to diminish the effort people have made or dismiss problems that have been raised. If you feel that we should reopen this issue, then please let us know so that we can reprioritize it. Thanks!

@dimalsv
Copy link

dimalsv commented May 26, 2023

Hi guys, this issue is still relevant.

@stefannibrasil
Copy link
Contributor

Thanks for reporting the bug and for your patience. I took a quick look at the PhoneNumber generator and it looks like it hasn't been changed in a while. I can't say what the intention was when this generator was added but I'm planning on working on this next Friday.

@stefannibrasil
Copy link
Contributor

Thanks for your patience, everyone! Please take a look at the proposed changes to fix this bug here #2842

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 a pull request may close this issue.

6 participants