-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2023-12-07] [$500] Bank-Error does not appear under "Company Website" after entering caps "H" in url #31362
Comments
Job added to Upwork: https://www.upwork.com/jobs/~010d45541c5ea54e51 |
Triggered auto assignment to @MitchExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale ( |
ProposalPlease re-state the problemBank-Error does not appear under "Company Website" after entering caps "H" in url What is the root cause of the problem?We are disabling case sensitivity here: App/src/libs/ValidationUtils.ts Line 203 in 8872311
What changes should be made?We should remove the |
ProposalPlease re-state the problem that we are trying to solve in this issue.I think the expectation in the OP is not correct. Website with uppercase characters in it are completely valid websites, in composer we're also allowing uppercase characters. But when saving the website here we should ideally lowercase it so it will show up nicely in other places where the data is used. (Note: all browsers also does this, if you type the site in uppercase, no error will show, the browser will just convert to lowercase and navigate you to the site) What is the root cause of that problem?We're not lowercasing the website before saving to the back-end What changes do you think we should make in order to solve the problem?Lowercase the website before saving to the back-end To do this, we can add something like this below here
What alternative solutions did you explore? (Optional)We can consider additionally lowercase the website as soon as the user blurs the website input. Optionally, we can improve a bit by allowing users to omit the protocol part of the URL and use |
ProposalPlease re-state the problem that we are trying to solve in this What is the root cause of that problem?
What changes do you think we should make in order to solve the problem? What alternative solutions did you explore? (Optional) Contributor Details: |
📣 @superdev808! 📣
|
ProposalPlease re-state the problem that we are trying to solve in this issue.After add a "Company Website" that contains uppercase in the protocol (http, https or ftp), i.e: Http, httpS, of FTP; an error should appear under the "Company Website" input field, also the bar below the input should turn red indicating that is an invalid website. What is the root cause of that problem?Exists a function called What changes do you think we should make in order to solve the problem?Unfortunately JavaScript do not support have part of the regular expression be case-insensitive. Other languages support it using the (?i:) pattern modifier. On this JavaScript project a case-insensitive modifier is applied to the entire regular expression so to solve the issue one solution is: Add a simple REGEX validation prior the existent return on function isValidWebsite in order to check that the website URL do not have uppercase on the protocol, and return false if positive. What alternative solutions did you explore? (Optional)Force the Website URL protocol to be all in lowercase, changing the user input when the focus change, adding this change the function isValidWebsite will receive a "valid" url. |
📣 @sgroh! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
This is a fairly straightforward issue, and I recommend going with @esh-g's proposal since the validation being performed on the frontend would be consistent with the expected rules for the URL string in the backend. The 🎀 👀 🎀 C+ reviewed. |
Triggered auto assignment to @AndrewGable, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@akinwale That'd be inconsistent with the rest of the app, where uppercase characters are allowed, for example in Composer. cc @AndrewGable |
In order to maintain this consistency, the validation logic would have to be changed in the backend. While both proposals are viable approaches to solving the issue, the idea behind my recommendation is to validate early to prevent an unnecessary request from being sent to the backend. Additionally, the Ultimately, the internal engineer will make a final decision. |
@akinwale with my proposal, there's no change required in the back-end, we'll lowercase it before sending to the back-end (same as what all browsers do)
There's no unnecessary request sent to the back-end as well, the website will be lowercased before sending to back-end which is a totally valid request and will not throw any error. What we manage to avoid here, is confusion for the users and more work for them to make sure they type only lowercase, which will happen if we go with the selected proposal. Imagine if you type an uppercase site address like cc @AndrewGable |
Hi @akinwale I understand your point, in my proposal I'm only checking that the protocol (http, https of ftp) do not contains uppercase, not allowing the user post the URL until he/she enter it using lowercase. BTW as the standard explains URLs in general are case-sensitive. So I'm allowing it to have uppercase after the protocol. |
@AndrewGable, @akinwale, @MitchExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @esh-g 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@AndrewGable do you have any feedback for this? Thanks! |
@AndrewGable, @akinwale, @MitchExpensify, @esh-g Whoops! This issue is 2 days overdue. Let's get this updated quick! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.5-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-12-07. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue: |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@AndrewGable do you have any feedback for this? Thank you! |
All paid have you had a chance to review the BZ steps @akinwale ? |
Not a regression. The backend has some validation logic for the website field that was not implemented in the frontend.
Regression test steps
Do we agree 👍 or 👎? |
@MitchExpensify Done. |
Nice, thanks @akinwale |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.3.99-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
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation: @
Action Performed:
("H" in caps)
Expected Result:
In company information page, an error should appear under the "Company Website" input field and the bar below it should turn red.
Actual Result:
In company information page, an error does not appear under the "Company Website" input field and the bar below it is in green instead of red.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6277061_1700039930100.below.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: