-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$1000] Phone number and company URL field isn’t highlighted when it fails validation upon form submission. #16760
Comments
Triggered auto assignment to @greg-schroeder ( |
Bug0 Triage Checklist (Main S/O)
|
@greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@greg-schroeder Huh... This is 4 days overdue. Who can take care of this? |
Reviewing now, sorry for the delay |
I don't think this is a duplicate, and I was able to reproduce on web. |
Job added to Upwork: https://www.upwork.com/jobs/~0170d7d8b2289c9967 |
Triggered auto assignment to @Christinadobrzyn ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
Triggered auto assignment to @pecanoro ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.when adding the wrong phone number or company URL then border is not highlighted red color for these 2 fields What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
App/src/libs/ValidationUtils.js Line 289 in ef6977e
here for sanitizedPhone we are replacing all the non alpha numeric values with empty string, but from testing it looks like the backend only replace
What alternative solutions did you explore? (Optional)none |
I think we should handle this with #16874. The two are very similar. |
Hey @allroundexperts - good catch. Going to ask if we should combine or handle separately. I'll remove |
@greg-schroeder Should we group the issues then? I see the discussion in the other issue kept going 😄 |
@rushatgabhane can you please look into this if we should HOLD the current issue for the mentioned issue? |
ProposalPlease re-state the problem that we are trying to solve in this issue.Form fields for company information page are not highlighted with red when there is an error from api after form submission What is the root cause of that problem?We are addressing 2 problems here
What changes do you think we should make in order to solve the problem?
function getPhoneNumberWithoutUSCountryCodeAndSpecialChars(phone) {
const phoneWithoutSpecialChars = (phone || '').replace(CONST.REGEX.NON_ALPHA_NUMERIC, '');
return getPhoneNumberWithoutSpecialChars(phoneWithoutSpecialChars.replace(/^\+1/, ''));
}
/^((https?|ftp):\/\/)(([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}(:(([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(#[-a-z\d_]*)?$/i I would also suggest to update the backend to not use/allow port 0 with urls What alternative solutions did you explore? (Optional)N/A |
@rushatgabhane I tried the accepted proposal fix for #17205, it doesn't allow port numbers in url, maybe that's the desired behaviour at the end? #17461 adds validations to phone numbers but the validations are already passing for phone numbers in this issue. We are just not sending the sanitized values to the api which is causing the issue. |
@huzaifa-99 It does allow port numbers that are valid ie 80, 8080, 9000 etc |
@allroundexperts Hm, interesting. I did another test and it seems like it will pass any port that is between 2 and 4 digits. Notice the But it fails with a 1 digit or 5 digit port
It will pass this case but notice the leading 0 It also does not check for valid port range |
Thanks for your insights @huzaifa-99. I think it might be better to create a PR that adds these missing port number range to the |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Let's close this issue then if it will get fixed in the other one. Also, I saw the person reporting is the same for both and the errors are so similar that I think it's ok to pay just the other reporting bonus. |
Reopening this issue as it's happening. Contributor reported in the #expensify-bugs channel here https://expensify.slack.com/archives/C049HHMV9SM/p1684745553939399 and I'm still able to reproduce it. Recording.2828.mp4 |
Looking |
@rushatgabhane @pecanoro Hmm - both #17461 and #17205 are complete, but this appears to still be a thing. I'm curious what went wrong as far as those not fixing this incidentally |
cc @thesahindia @s77rt any idea what went wrong in the PR for the above issues? They should have fixed this issue. (im out rn, so can't investigate) |
Hmm, I wonder if some PR brought this back as a regression. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
I don't think the same issue is reproducible here. We are looking at a similar yet different issue. The first one was about getting a RBR error from backend even though the number is said to be correct. This behaviour is fixed, now as long as you don't see an error message in the phone number then it will work. The reason some numbers that contain letters work as seen in the above video is due to how to the |
@pecanoro, @greg-schroeder, @rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@s77rt I saw the video again and you are right. It seems even the back-end takes the number as valid or at least I don't see any errors being thrown. If that's the case, we can just close this issue again. |
All right - I will re-close per above. |
We always send the backend the number in e164 format. This will always work. |
Got it, so this is working as expected then. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Notice that upon form submission, the field number isn’t red highlighted.
Similar case occurs on company url too . Try “https://example.com:10000000”
Expected Result:
Form field with errors should be highlighted in red even if the error comes form backend.
Actual Result:
Errors got on form submission aren’t highlighted in red.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.92-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-03-30.at.5.55.56.PM.mov
Recording.104.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ashimsharma10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680178415219629
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: