-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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-05-05] [$1000] URL validator fails in some cases #17205
Comments
Triggered auto assignment to @puneetlath ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~01c611185cf24bd850 |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
Making external. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Website field validation does not work in the connect bank account page. What is the root cause of that problem?The root cause is that we're using an incorrect regular expression to match the URL. This can be seen here. The Regex defined here considers any URL to be valid if it contains a dot in it. It does not validate the TLD of the domain. What changes do you think we should make in order to solve the problem?We need to use the URL regex that is defined in the
Then in the
We should also remove the regex defined here as its not needed. Note: This will validate the URLs which have any path added to them such as What alternative solutions did you explore? (Optional)None |
ProposalPlease re-state the problem that we are trying to solve in this issue.URL validator fails in some cases What is the root cause of that problem?Root cause of this problem is that the WEBSITE regex constant does not cover all cases. What changes do you think we should make in order to solve the problem?Add negative regex that will only match "https://www.abc". Only value that match regex and does not pass negative regex will be validated. What alternative solutions did you explore? (Optional)
|
📣 @nhminhduc! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
@allroundexperts, I tried your proposal. I used @nhminhduc, can't we just improve the regex? |
@thesahindia Yes, as in the alternative stackoverflow, there is a regex that can solve this. After a bit of modification Website to test regex against list of url: |
@thesahindia |
ProposalPlease re-state the problem that we are trying to solve in this issue.The URL validator fails for certain website URLs. What is the root cause of that problem?It is due to insufficient regex validation, as pointed out by @allroundexperts. What changes do you think we should make in order to solve the problem?We need to enforce a better regex validation standard. App/src/libs/ValidationUtils.js Lines 36 to 42 in e8bc6a8
This will cover all the follwoing cases:
I believe it is required to let the user enter any URL as you never know what kind of company website the user has and if they got any hacks/workarounds that redirect users and/or require extra identifiers. |
Dear Contributors For example, "https://www.thisisaverylongdomainnamethatexceedsthelimitof63characters.com/" instead of "https://www.example.com/". |
@ashimsharma10 made a new regex to limit the domain name to maximum 63 characters: |
Yes I'm uncertain whether we need to validate that each label's length does not exceed 63 characters. In my opinion, I don't think it's a practical scenario to consider. What do you think about this? |
@thesahindia We are using the above everywhere else on our website. We can modify it to not include |
Sry @allroundexperts, I wanted to comment on a different ticket 😅 |
C/P @ashimsharma10's comment
@puneetlath, before moving forward can you please confirm if we wanna consider this case? In my opinion, I don't think it's a practical scenario to consider. |
Yes, I agree. I think we're okay not worrying about that. |
📣 @allroundexperts You have been assigned to this job by @puneetlath! |
This comment was marked as off-topic.
This comment was marked as off-topic.
@puneetlath, @allroundexperts, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
PRs are in active review. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.7-3 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-05-05. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
@thesahindia @allroundexperts sent you offers. @ashimsharma10 can you apply to the Upwork job? https://www.upwork.com/jobs/~01c611185cf24bd850 @thesahindia also a friendly reminder about the checklist! |
Not sure if we should call this a regression. l would prefer just checking off the first three items since this was a minor improvement. Regression test proposal
|
I can see that. Works for me. |
Checklist is done. Should be good to pay everyone on 5/5. @ashimsharma10 bump on applying to the Upwork job? https://www.upwork.com/jobs/~01c611185cf24bd850 |
@puneetlath Can you please send me an offer directly? I'm out of Upwork connects. |
All paid. Thanks everyone! |
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:
Expected Result
An error should be displayed for an invalid URL.
Actual Result
No error message is displayed for an invalid URL, regardless of the format provided below the “Company Website” field.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.97-2

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
7.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ashimsharma10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680991312415289
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: