Uninett / Argus

Argus is an alert aggregator for monitoring systems
GNU General Public License v3.0
19 stars 14 forks source link

It is possible to add phone number with up to 2 letters in destinations #578

Open podliashanyk opened 1 year ago

podliashanyk commented 1 year ago

Registered phone number contains no letters, but no error is reported by backend.

Suggested by @stveit in https://github.com/Uninett/Argus-frontend/pull/475#issuecomment-1410122159

If you edit an existing phone number, you can add up to 2 letters to the number and when you try to save you will get the error message that the number already exists, instead of it being invalid. probably a backend thing? or does a few letters just not matter for real phone numbers? seems weird

the same for creating basically, it allows you to create a phone number with 2 letters. It seems like the phone number library allows up to 2 letters but just strips them, so when editing it says "same number" because after stripping it becomes the same number

johannaengland commented 1 year ago

This bug is not caused by Argus itself, but by the library that is used to validate phone numbers.

The stripping occurs here: https://github.com/daviddrysdale/python-phonenumbers/blob/a60408d5f75034f06cf79abd09eef9c83ad57877/python/phonenumbers/phonenumberutil.py#L2866

Now we need to decide if we want to add that part of validation ourselves or accept this bug.