Closed nicolasrouanne closed 3 years ago
@nicolasrouanne Hi, I checked these numbers in the original libphonenumber here and number is possible but not valid there. You can open an issue for them
Hello, We are facing the same issue on our end, FYI I filled a report ticket on libphonenumber side: https://issuetracker.google.com/issues/179166703.
Just to sum it up after libphonenumber
answered the ticket:
phonelib
is not, phonelib is barely using libphonenumber
for validationlibphonenumber
seems to be correctly validating French phone numbers; when they say it's invalid... it's that it is
for instance
+33696339246
which seems to have a valid french format, as in "+ 33 6 # ## ## ## ##", is actually invalid as it overlaps with Reunion number
I was generating phones using this pattern Faker::Base.numerify('+33 6 ## ## ## ##')
, which actually generates "possible" formats (i.e. with the correct number pattern), but not always "valid" phone numbers. Phone number validation is more complex than just a regex.
I then switched to Faker::PhoneNumber.cell_phone
, which seems promising generating valid phone numbers. However, there seems to be an issue in faker's fr
locale for valid french phone numbers ATM: https://github.com/faker-ruby/faker/issues/1650, https://github.com/faker-ruby/faker/issues/1957. May be fixed by https://github.com/faker-ruby/faker/pull/1968, but it's not merged at the time of writing.
I'm closing this issue, as it's not a bug, rather a failure on my side to generate random valid test data.
Some valid FR cell phone numbers are now considered invalid with release
0.6.47
, while they were valid with0.6.46
For instance
Example numbers considered as invalid in
0.6.47
although they are valid in0.6.46
(and they are indeed valid): +33696339246, +33692746428, +33639538676, +33639891873, +33692018258, etc.