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

[HOLD for payment 2023-10-27] [$500] IOU Category - Search message shows 'Invalid email' when typing email address in search field #28078

Closed
6 tasks done
lanitochka17 opened this issue Sep 23, 2023 · 50 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 23, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Issue found when executing PR #27459

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to any workspace chat
  3. Go to + > Request money > Manual
  4. Enter an amount
  5. Click Show more > Category.
  6. Enter a few letters, followed by @

Expected Result:

The message below the search field will display 'No results found'..

Actual Result:

The message below the search field displays 'invalid email' when Category search does not involve email

Workaround:

Unknown

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.73-0

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6211688_20230923_190412.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0131655c00ab293751
  • Upwork Job ID: 1710313308418142208
  • Last Price Increase: 2023-10-13
  • Automatic offers:
    • DylanDylann | Contributor | 27217343
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

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

@DylanDylann
Copy link
Contributor

Proposal

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

IOU Category - Search message shows 'Invalid email' when typing email address in search field

What is the root cause of that problem?

if (searchValue && !hasSelectableOptions && !hasUserToInvite) {
if (/^\d+$/.test(searchValue) && !isValidPhone) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}
if (/@/.test(searchValue) && !isValidEmail) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidEmail');
}
if (hasMatchedParticipant && (isValidEmail || isValidPhone)) {
return '';
}

Let's see the logic to get header message, we are checking if the search value includes "@" we will display errorMessageInvalidEmail instead of noResultsFound

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

In this case, we don't search email and phone number

if (/^\d+$/.test(searchValue) && !isValidPhone) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}
if (/@/.test(searchValue) && !isValidEmail) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidEmail');
}
if (hasMatchedParticipant && (isValidEmail || isValidPhone)) {
return '';
}

So this logic to redandunt. We need to pass one more params called includeEmailAndPhoneNumber to getHeaderMessage function

and only apply logic to check email and phone if this param is true

What alternative solutions did you explore? (Optional)

@Christinadobrzyn
Copy link
Contributor

Not sure how to make a Category, asking QA - https://expensify.slack.com/archives/C9YU7BX5M/p1695681312874909

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Sep 27, 2023

still trying to get Categories to work on my [email protected] account.

Asking if anyone else has this issue? https://expensify.slack.com/archives/C01SKUP7QR0/p1695845916425979

@Christinadobrzyn Christinadobrzyn added the Needs Reproduction Reproducible steps needed label Sep 28, 2023
@Christinadobrzyn

This comment was marked as outdated.

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 29, 2023

@Christinadobrzyn I still can reproduce this bug on the latest main by enabling permission in the codebase. You can ping C+ team or internal engineer to help verify the bug

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 2, 2023

@Christinadobrzyn This is an example of category issue: #28079

@DylanDylann
Copy link
Contributor

@s77rt It seems @Christinadobrzyn can't access the category feature. Because you are C+ Contributor of another issue that relates to category #28517. Could you help to verify this is a bug?
Sorry, If I bothers you

@s77rt
Copy link
Contributor

s77rt commented Oct 4, 2023

I can reproduce the bug

Screenshot 2023-10-04 at 4 29 35 PM

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Oct 6, 2023

Thanks @DylanDylann! I'll reopen and assign a C+ since you can still see it's happening.

@Christinadobrzyn Christinadobrzyn added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Oct 6, 2023
@melvin-bot melvin-bot bot changed the title IOU Category - Search message shows 'Invalid email' when typing email address in search field [$500] IOU Category - Search message shows 'Invalid email' when typing email address in search field Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0131655c00ab293751

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Oct 6, 2023

Proposal

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

IOU Category - Search message shows 'Invalid email' when typing email address in search field

What is the root cause of that problem?

To determine the email, we only use the presence of @ in the line

if (/@/.test(searchValue) && !isValidEmail) {

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

But what is email?
To put it roughly

leters => @ => leters => . => leters

(Plus numbers. But I'm not sure that they can be used in every point in my scheme)

So we can use this regex /\w+@\w+\.\w+/
to check, the text looks like an email or not

and then we will check string is valid or not using isValidEmail

As a result

        if (/\w+@\w+\.\w+/.test(searchValue)) {
            if (!isValidEmail) {
                return Localize.translate(preferredLocale, 'messages.errorMessageInvalidEmail');
            }
        }

if (/@/.test(searchValue) && !isValidEmail) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidEmail');
}

But actually it would be great
Get several test cases
To check what we expect ))

Screen.Recording.2023-10-06.at.17.57.07.mov

What alternative solutions did you explore? (Optional)

@ChrisCates
Copy link

ChrisCates commented Oct 6, 2023

@ZhenjaHorbach, I'm also interested in the project.

By the way the regular expression you suggested will work for validation only if there is no punctuation in the TLD.

/\w+@\w+\.\w+/

It's better to use:

/\S+@\S+\.\S+/

This will return the whole email on a match. And not partial using the \w expression if the email has punctuation.
The regex you provided will break if the TLD has punctuation in it.

Hope this helps.

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

📣 @ChrisCates! 📣
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.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@ChrisCates
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01ed9060ff74912e35

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Oct 6, 2023

Screenshot 2023-10-06 at 18 09 16

No, everything is good )

Screenshot 2023-10-06 at 18 11 16

Plus it's just an idea )
First need to get more information)

And regular expression will be updated after final requirements

@melvin-bot melvin-bot bot added the Weekly KSv2 label Oct 17, 2023
@DylanDylann
Copy link
Contributor

@rushatgabhane this PR is ready for review

@rushatgabhane
Copy link
Member

approved

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

🎯 ⚡️ Woah @rushatgabhane / @DylanDylann, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @DylanDylann got assigned: 2023-10-16 10:16:13 Z
  • when the PR got merged: 2023-10-18 07:08:00 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 20, 2023
@melvin-bot melvin-bot bot changed the title [$500] IOU Category - Search message shows 'Invalid email' when typing email address in search field [HOLD for payment 2023-10-27] [$500] IOU Category - Search message shows 'Invalid email' when typing email address in search field Oct 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.87-12 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-10-27. 🎊

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

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:

  • [@rushatgabhane] The PR that introduced the bug has been identified. Link to the PR:
  • [@rushatgabhane] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@rushatgabhane] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@rushatgabhane] Determine if we should create a regression test for this bug.
  • [@rushatgabhane] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 27, 2023
@MariaHCD
Copy link
Contributor

I believe we just need the BZ checklist here so we can proceed with the payments

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@Christinadobrzyn
Copy link
Contributor

Payouts due:

Issue Reporter: NA - reporter is Applause
Contributor: $500 + $250 speed bonus @DylanDylann (Paid through Upwork)
Contributor+: $500 + $250 speed bonus @rushatgabhane (paid manually in NewExpensify)

Eligible for 50% #urgency bonus? Y - #28078 (comment)

Upwork job is here.

@rushatgabhane could you let us know about a regression test?

@Christinadobrzyn
Copy link
Contributor

nudge @rushatgabhane about a regression test, thanks!

@melvin-bot melvin-bot bot added the Overdue label Nov 3, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

@MariaHCD, @rushatgabhane, @Christinadobrzyn, @DylanDylann Eep! 4 days overdue now. Issues have feelings too...

@Christinadobrzyn
Copy link
Contributor

Dming @rushatgabhane to see if we need a regression test

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@rushatgabhane
Copy link
Member

rushatgabhane commented Nov 7, 2023

  1. The PR that introduced the bug has been identified. Link to the PR: Categories UI/UX #26501

  2. The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/26501/files#r1384335093

  3. A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N.A.

  4. Determine if we should create a regression test for this bug. No

  5. If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again N.A.

@rushatgabhane rushatgabhane mentioned this issue Nov 7, 2023
59 tasks
@rushatgabhane
Copy link
Member

Created a manual request https://staging.new.expensify.com/r/8819237970145454

@Christinadobrzyn
Copy link
Contributor

awesome! I think this can be closed.

@JmillsExpensify
Copy link

$750 payment approved for @rushatgabhane based on this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants