Skip to content
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] Invalid email prefixes aren’t treated as invalid in contact methods page #17839

Closed
6 tasks done
kavimuru opened this issue Apr 22, 2023 · 13 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kavimuru
Copy link

kavimuru commented Apr 22, 2023

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:

  1. Go to staging dot
  2. Go to profile-> contact method-> new contact
  3. On email/phone number field enter the following mailing addresses
  4. abc-@mail.com
  5. abc#def@mail.com
    Note :
    According to RFC 5322, which defines the standard for email addresses, the local-part (the part before the '@' symbol) can only contain certain characters, including alphanumeric characters, dots, and a limited set of special characters, such as underscores and hyphens. The pound sign (#) is not one of the allowed special characters.
    Also, The local-part cannot start or end with a hyphen, so the email address "abc-@mail.com" is considered invalid.

Expected Result:

error handling with improper email address

Actual Result:

Some cases are not checked properly..

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.4
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

Record_2023-04-22-10-02-37.mp4
Recording.316.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ashimsharma10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1682146812820119
View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015a1956a9c964cbc5
  • Upwork Job ID: 1650863060849467392
  • Last Price Increase: 2023-04-25
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 22, 2023
@MelvinBot
Copy link

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Overdue label Apr 25, 2023
@abekkala abekkala added the External Added to denote the issue can be worked on by a contributor label Apr 25, 2023
@melvin-bot melvin-bot bot changed the title Invalid email prefixes aren’t treated as invalid in contact methods page [$1000] Invalid email prefixes aren’t treated as invalid in contact methods page Apr 25, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~015a1956a9c964cbc5

@MelvinBot
Copy link

Current assignee @abekkala is eligible for the External assigner, not assigning anyone new.

@abekkala
Copy link
Contributor

I was able to recreate using an incorrect hyphen placement

@MelvinBot
Copy link

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

@melvin-bot melvin-bot bot added Help Wanted Apply this label when an issue is open to proposals by contributors and removed Overdue labels Apr 25, 2023
@MelvinBot
Copy link

Triggered auto assignment to @francoisl (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@aimane-chnaif
Copy link
Contributor

I suggest to put this on hold for #17387 which has possibility to unify all email validations.

@huzaifa-99

This comment was marked as off-topic.

@jaymangukiya0001
Copy link

jaymangukiya0001 commented Apr 27, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.
the invalid special character is allowed as a prefix in the email.

What is the root cause of that problem?

in the src/pages/settings/profile/contacts/newContactMethodPage.js line, no 82 is having inbuilt validation method which looks inappropriate in some cases for the special character at the prefix.

What changes do you think we should make in order to solve the problem?

we can use regex ^([a-z0-9\+\.\/&!][-a-z0-9\+\._\/&!]*[A-Za-z0-9])@(([a-z0-9][-a-z0-9]*\.)([-a-z0-9]+\.)*[a-z]{2,})$ to match email string which passes all the test cases as per the email format you mentioned in this issue.

What alternative solutions did you explore? (Optional)

I have explored the third-party packages but it can be inappropriate for some cases.

@melvin-bot melvin-bot bot added the Overdue label Apr 27, 2023
@parasharrajat
Copy link
Member

@abekkala I think we can close this as it seems a duplicate of #17387

@melvin-bot melvin-bot bot removed the Overdue label Apr 28, 2023
@abekkala
Copy link
Contributor

Ah good call. I didn't see that one when I looked. Must have used a bad search term. That one was created well before this one so closing.

Thanks @parasharrajat

@jaymangukiya0001
Copy link

jaymangukiya0001 commented Apr 29, 2023

@parasharrajat @abekkala @MelvinBot i don't think so that regex mentioned in !17387 will include all the test cases for identifying the email totally valid. Here is the proof.
WhatsApp Image 2023-04-29 at 3 10 07 PM

I think my regex is more appropriate (passing all the test cases that you have mentioned in the issue except the length but i can add that check as well. )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants