bcgov / cas-registration

A web app for Registration in OBPS under the Clean Growth branch
Apache License 2.0
1 stars 1 forks source link

Phone number widget allows lengthy number #1398

Open zoeyli-46 opened 2 months ago

zoeyli-46 commented 2 months ago

Business area found that the business number field allows more than 9 digits; they received an entry with an incorrect format for the business number. This should be confirmed if that was a one-off situation, or if the form field validation has a bug.

This fix could possibly take care of #886 if we are changing the validation regex (maybe we can use the one Django uses)

Sepehr-Sobhani commented 2 months ago

Do we have more information about this issue? Anything related to the operator that has this invalid number.

marcellmueller commented 1 month ago

I'm surprised that the backend would accept a longer phone number. Though our PhoneWidget currently accepts longer numbers, both the input as well as the format validation doesn't trigger if you continue to type more numbers after inputting a valid one.

Sepehr-Sobhani commented 1 month ago

I just noticed that this is about cra_business_number and not phone_number 😄 I have checked the PROD data and we currently don't have any cra_business_number longer than 9 digits. We also have a validator on the back and front end to ensure this number is always 9 digits. We can look into it more if we know more details about this operator, so I think closing this issue is okay.

Image

marcellmueller commented 1 month ago
Screenshot 2024-06-06 at 1 32 05 PM

I suggest keeping this open, though perhaps we can rename it to be more general. I just tried another phone number field and it passes frontend validation with a lengthy number. Though thankfully we have the backend saving us, maybe this isn't high priority but I would like to fix it and maybe hardcode a max length into our PhoneWidget to ensure consistency.

Sepehr-Sobhani commented 3 weeks ago

Duplicate: https://github.com/orgs/bcgov/projects/122/views/2?filterQuery=&pane=issue&itemId=49731466