App
App copied to clipboard
[$250] Android - Chat - Starting chat with email id having apostrophe showing error
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:
- Launch app
- Tap fab-- start chat
- Enter email id with apostrophe eg: jaihanumanblog+4557'[email protected]
- 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
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~013af654cc6fe733d4
- Upwork Job ID: 1779877807418626048
- Last Price Increase: 2024-04-22
Triggered auto assignment to @miljakljajic (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
@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
We think that this bug might be related to #vip-vsp
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.
@miljakljajic Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Job added to Upwork: https://www.upwork.com/jobs/~013af654cc6fe733d4
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External
)
I think this can be worked on externally - thank you @lanitochka17 !
@getusha - there is a proposal ready to review when you have a chance!
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.
@miljakljajic, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!
But some other providers do allow it.
@ShridharGoel could you provide examples of email providers that do allow the kind of email?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@miljakljajic, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!
@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!
@ShridharGoel could you check this https://github.com/Expensify/App/issues/39933#issuecomment-2064873611
The specification allows it: https://en.wikipedia.org/wiki/Email_address#RFC_specification
@ShridharGoel seems like it when quoted, i am not sure how that works. could you add detailed implementation of your solution?
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.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@miljakljajic, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
I agree that this formatting is pretty rare and we could probably close this.
@miljakljajic, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!
@miljakljajic we can close this.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@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!
@miljakljajic, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!