App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Android - Chat - Starting chat with email id having apostrophe showing error

Open lanitochka17 opened this issue 10 months ago • 19 comments

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.4.61 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4484121 Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch app
  2. Tap fab-- start chat
  3. Enter email id with apostrophe eg: jaihanumanblog+4557'[email protected]
  4. Select the contact

Expected Result:

When user enters email id with apostrophe, if it is invalid, it must say invalid id and must not direct to conversation page. If it is valid id, "Auth createaccount returned an error", must not be displayed in conversation page

Actual Result:

User navigated to conversation page showing error "Auth createaccount returned an error" when starting conversation with user having email id with apostrophe

Workaround:

Unknown

Platforms:

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

  • [x] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/efcfb6f7-f77f-4329-b90f-a063fa1e0ec1

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013af654cc6fe733d4
  • Upwork Job ID: 1779877807418626048
  • Last Price Increase: 2024-04-22

lanitochka17 avatar Apr 09 '24 13:04 lanitochka17

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

melvin-bot[bot] avatar Apr 09 '24 13:04 melvin-bot[bot]

@miljakljajic FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

lanitochka17 avatar Apr 09 '24 13:04 lanitochka17

We think that this bug might be related to #vip-vsp

lanitochka17 avatar Apr 09 '24 13:04 lanitochka17

Proposal

Please re-state the problem that we are trying to solve in this issue.

Android - Chat - Starting chat with email id having apostrophe showing error

What is the root cause of that problem?

The EMAIL_BASE_REGEX is incorrect, it allows '. https://github.com/Expensify/expensify-common/blob/13de5b0606662df33fa1392ad82cc11daadff52e/lib/CONST.jsx#L3-L4

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

We need to update the regex to exclude '.

const EMAIL_BASE_REGEX =
    "(?=((?=[\\w#%+-]+(?:\\.[\\w#%+-]+)*@)[\\w\\.#%+-]{1,64}@(?:(?=[a-z\\d]+(?:-+[a-z\\d]+)*\\.)(?:[a-z\\d-]{1,63}\\.)+[a-z]{2,63})(?= |_|\\b))(?<end>.*))\\S{3,254}(?=\\k<end>$)";

What alternative solutions did you explore? (Optional)

We can also exclude other characters like #, %, these are also not supported.

Krishna2323 avatar Apr 09 '24 13:04 Krishna2323

@miljakljajic Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Apr 12 '24 18:04 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~013af654cc6fe733d4

melvin-bot[bot] avatar Apr 15 '24 14:04 melvin-bot[bot]

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

melvin-bot[bot] avatar Apr 15 '24 14:04 melvin-bot[bot]

I think this can be worked on externally - thank you @lanitochka17 !

@getusha - there is a proposal ready to review when you have a chance!

miljakljajic avatar Apr 15 '24 14:04 miljakljajic

Proposal

Please re-state the problem that we are trying to solve in this issue.

Chat - Starting chat with email id having apostrophe showing error.

What is the root cause of that problem?

Gmail doesn't allow ' and # type of characters in the mail ID. But some other providers do allow it.

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

If we want to fix this, then we will need to have a Gmail-specific check for such special characters.

ShridharGoel avatar Apr 15 '24 14:04 ShridharGoel

Proposal Updated

  • Added alternative incase we also want to handle # & %

Krishna2323 avatar Apr 15 '24 14:04 Krishna2323

@miljakljajic, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Apr 18 '24 18:04 melvin-bot[bot]

But some other providers do allow it.

@ShridharGoel could you provide examples of email providers that do allow the kind of email?

getusha avatar Apr 18 '24 18:04 getusha

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Apr 22 '24 16:04 melvin-bot[bot]

@miljakljajic, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Apr 22 '24 18:04 melvin-bot[bot]

@miljakljajic @getusha this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Apr 23 '24 18:04 melvin-bot[bot]

@ShridharGoel could you check this https://github.com/Expensify/App/issues/39933#issuecomment-2064873611

getusha avatar Apr 23 '24 18:04 getusha

The specification allows it: https://en.wikipedia.org/wiki/Email_address#RFC_specification

ShridharGoel avatar Apr 24 '24 05:04 ShridharGoel

@ShridharGoel seems like it when quoted, i am not sure how that works. could you add detailed implementation of your solution?

getusha avatar Apr 26 '24 08:04 getusha

Proposal

Please re-state the problem that we are trying to solve in this issue.

Invalid Id's are currently still being redirected to the conversation page and returning Auth createAccount error instead of returning invalid id .

What is the root cause of that problem?

When a user inputs a name, email, or phone number, if the contact information isn't already in the user's contact list or recent contacts, an optimistic ID is generated. For emails, an optimistic ID is generated and returned only if the email entered by the user conforms to the Email Base Regex, which permits special characters such as #, %, +, ', and -. I believe the Authentication Service restricts account creation with emails containing specific special characters, hence the Auth createaccount error returned.

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

Update the email base REGEX to align with the emails supported by the Authentication Service, and identify and adjust specific use cases where special characters are permitted. For instance, the option for the + character to be appended for creating multiple test accounts.

SaintSlim avatar Apr 27 '24 23:04 SaintSlim

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Apr 29 '24 16:04 melvin-bot[bot]

@miljakljajic, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Apr 29 '24 18:04 melvin-bot[bot]

I agree that this formatting is pretty rare and we could probably close this.

miljakljajic avatar Apr 30 '24 13:04 miljakljajic

@miljakljajic, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar May 03 '24 18:05 melvin-bot[bot]

@miljakljajic we can close this.

getusha avatar May 03 '24 19:05 getusha

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar May 07 '24 00:05 melvin-bot[bot]

@miljakljajic @getusha this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar May 07 '24 01:05 melvin-bot[bot]

@miljakljajic, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar May 07 '24 01:05 melvin-bot[bot]