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-08-24] [HOLD for payment 2023-08-21] [$1000] Split bill - 'No results found' appears after selecting the user in split bill member search #22959

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 15, 2023 · 62 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 Jul 15, 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.new.expensify.com
  2. Click + icon > Split bill > Enter amount > Next.
  3. Type an email address.
  4. Select the member in search result

Expected Result:

There is no error message after selecting the member in the search result

Actual Result:

No results found' appears after selecting the member in the search result

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.41.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

Bug6127080_20230713_235416.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Interanl Team

Slack conversation:

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0199d5a89c5f1a937a
  • Upwork Job ID: 1681294844527841280
  • Last Price Increase: 2023-08-01
  • Automatic offers:
    • fedirjh | Reviewer | 25952719
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 15, 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

@allroundexperts
Copy link
Contributor

allroundexperts commented Jul 16, 2023

Proposal

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

No results found appears after selecting the user in split bill number search

What is the root cause of that problem?

The root cause of the issue is that when selecting a participant which does not exist and needs to be invited, after getting selected, we're emptying our userToInvite array. This is incorrect since the user still needs to be invited. Since the invited user array is empty, when getting the header message here, we get a no result found error to show up.

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

Similar to how this is being done in the new chat page, we can change this to:

const chatOptions = OptionsListUtils.getNewChatOptions(reports, personalDetails, betas, searchTerm, [], CONST.EXPENSIFY_EMAILS);

Then, we'll need to change this to:

const chatOptions = OptionsListUtils.getNewChatOptions(reports, personalDetails, betas, searchTerm, [], CONST.EXPENSIFY_EMAILS);

We'll finally also need to replace this with:

  const filterText = _.reduce(participants, (str, {login}) => `${str} ${login}`, '');
  const hasUnselectedUserToInvite = newChatOptions.userToInvite && !filterText.includes(newChatOptions.userToInvite.login);

  if (hasUnselectedUserToInvite) {

What alternative solutions did you explore? (Optional)

We need to replace this with:

        newChatOptions.personalDetails.length + 
        newChatOptions.recentReports.length + 
        _.filter(participants, ({login}) => login.includes(searchTerm)).length !== 0,

@melvin-bot melvin-bot bot added the Overdue label Jul 18, 2023
@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 18, 2023
@melvin-bot melvin-bot bot changed the title Split bill - 'No results found' appears after selecting the user in split bill member search [$1000] Split bill - 'No results found' appears after selecting the user in split bill member search Jul 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0199d5a89c5f1a937a

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

melvin-bot bot commented Jul 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

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

@mallenexpensify
Copy link
Contributor

The root cause of the issue is that when selecting a participant which does not exist and needs to be invited,

@allroundexperts , this happens with existing accounts too, was able to reproduce
image

@melvin-bot melvin-bot bot removed the Overdue label Jul 18, 2023
@spcheema
Copy link
Contributor

spcheema commented Jul 18, 2023

The root cause of the issue is that when selecting a participant which does not exist and needs to be invited,

@allroundexperts , this happens with existing accounts too, was able to reproduce

Regardless of new or existing participants, getHeaderMessage func should not preform any further validation when the given search term is valid phone number or email.

@allroundexperts
Copy link
Contributor

Regardless of new or existing participants, getHeaderMessage func should preform any further validation when the given search term is valid phone number or email.

I'm not fully sure about this to be honest. If there's any place where we're searching for existing users only, then I think this will not show No members found error. I don't know if such a place exists now.

@spcheema
Copy link
Contributor

spcheema commented Jul 18, 2023

Regardless of new or existing participants, getHeaderMessage func should not preform any further validation when the given search term is valid phone number or email.

I'm not fully sure about this to be honest. If there's any place where we're searching for existing users only, then I think this will not show No members found error. I don't know if such a place exists now.

@allroundexperts Since you are an expert contributor so you have more responsibility 😉

Below condition in the getHeaderMessage does not make sense if the given search term is valid. Adding users to the group is just band-aid way to fix the problem. I would suggest to test it and give your valuable opinion. Honestly I am new to this app but flow control isn't relevant.

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'); 
     } 
  
     return Localize.translate(preferredLocale, 'common.noResultsFound'); 
 } 

@allroundexperts
Copy link
Contributor

allroundexperts commented Jul 18, 2023

Adding users to the group is just band-aid way to fix the problem

I don't think that this statement is entirely correct. A user which does not exist, should be added to userToInvite array. This is what this array is meant for. In current case, we're not adding that once we select that user. This is in-consistent with how we're doing this elsewhere in our App. That being said, I could be wrong as well.

Also, since I've proposed a solution here, I would really refrain from testing your solution and giving my opinion since this would be a case of conflict of interest.

As such, I'll wait for @fedirjh to weigh in here!

@spcheema
Copy link
Contributor

Adding users to the group is just band-aid way to fix the problem

I don't think that this statement is entirely correct. A user which does not exist, should be added to userToInvite array. This is what this array is meant for. In current case, we're not adding that once we select that user. This is in-consistent with how we're doing this elsewhere in our App. That being said, I could be wrong as well.

Also, since I've also proposed a solution here as well, I would really refrain from testing your solution and giving my opinion since this would be a case of conflict of interest.

As such, I'll wait for @fedirjh to weigh in here!

I think I miss understood the requirements. You are right. We need that list in the case of existing participants.

@melvin-bot melvin-bot bot added the Overdue label Jul 20, 2023
@mallenexpensify
Copy link
Contributor

Still waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Jul 20, 2023
@luckyman0305
Copy link
Contributor

luckyman0305 commented Jul 21, 2023

Proposal

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

On the split bill page, after search Name or email and select user, there is an error message like "No results found"
Should be no error message.

What is the root cause of that problem?

const headerMessage = OptionsListUtils.getHeaderMessage(
        newChatOptions.personalDetails.length + newChatOptions.recentReports.length !== 0,
        Boolean(newChatOptions.userToInvite),
        searchTerm,
        maxParticipantsReached,
    );

This function has no considered the selected members in the search result.
Should consider it.

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

Should consider selected members that is included in search text.
From

if (isOptionInList) {
newSelectedOptions = _.reject(participants, (selectedOption) => selectedOption.accountID === option.accountID);
} else {
newSelectedOptions = [...participants, {accountID: option.accountID, login: option.login, selected: true}];
}

To

            if (isOptionInList) {
                newSelectedOptions = _.reject(participants, (selectedOption) => selectedOption.accountID === option.accountID);
            } else {
                newSelectedOptions = [...participants, {accountID: option.accountID, login: option.login, selected: true, searchText: option.searchText}];
            }

From

const headerMessage = OptionsListUtils.getHeaderMessage(
newChatOptions.personalDetails.length + newChatOptions.recentReports.length !== 0,
Boolean(newChatOptions.userToInvite),
searchTerm,
maxParticipantsReached,
);

To

    const headerMessage = OptionsListUtils.getHeaderMessage(
        newChatOptions.personalDetails.length + newChatOptions.recentReports.length !== 0,
        Boolean(newChatOptions.userToInvite),
        searchTerm,
        maxParticipantsReached,
        participants.filter(participant => participant.searchText.includes(searchTerm)).length > 0
    );

From

function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false) {
if (maxParticipantsReached) {
return Localize.translate(preferredLocale, 'common.maxParticipantsReached', {count: CONST.REPORT.MAXIMUM_PARTICIPANTS});
}
const isValidPhone = parsePhoneNumber(LoginUtils.appendCountryCode(searchValue)).possible;
const isValidEmail = Str.isValidEmail(searchValue);
if (searchValue && CONST.REGEX.DIGITS_AND_PLUS.test(searchValue) && !isValidPhone) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}
// Without a search value, it would be very confusing to see a search validation message.
// Therefore, this skips the validation when there is no search value.
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');
}
return Localize.translate(preferredLocale, 'common.noResultsFound');
}

To

function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false, hasMatchedParticipant=false) { 
     if (maxParticipantsReached) { 
         return Localize.translate(preferredLocale, 'common.maxParticipantsReached', {count: CONST.REPORT.MAXIMUM_PARTICIPANTS}); 
     } 
  
     const isValidPhone = parsePhoneNumber(LoginUtils.appendCountryCode(searchValue)).possible; 
  
     const isValidEmail = Str.isValidEmail(searchValue); 
  
     if (searchValue && CONST.REGEX.DIGITS_AND_PLUS.test(searchValue) && !isValidPhone) { 
         return Localize.translate(preferredLocale, 'messages.errorMessageInvalidPhone'); 
     } 
  
     // Without a search value, it would be very confusing to see a search validation message. 
     // Therefore, this skips the validation when there is no search value. 
     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)
             return Localize.translate(preferredLocale, 'common.noResultsFound'); 
     } 
        
          
   

What alternative solutions did you explore? (Optional)

errorMessage.mov

@mallenexpensify
Copy link
Contributor

@fedirjh can you review @StanislavLavrenchuk 's proposal above please?

@fedirjh
Copy link
Contributor

fedirjh commented Jul 21, 2023

I think @allroundexperts's proposal make sense to me. We just make it consistent with new group page.


@StanislavLavrenchuk OptionsListUtils.getHeaderMessage is used in different pages , and each page have a different behaviour , have you considered that ?

@luckyman0305
Copy link
Contributor

luckyman0305 commented Jul 24, 2023

@fedirjh thanks your review.
we should change only the first param for this feature. no need change OptionsListUtils.getHeaderMessage function.
from

const headerMessage = OptionsListUtils.getHeaderMessage(
newChatOptions.personalDetails.length + newChatOptions.recentReports.length !== 0,
Boolean(newChatOptions.userToInvite),
searchTerm,
maxParticipantsReached,
);

to

   const headerMessage = OptionsListUtils.getHeaderMessage(
        newChatOptions.personalDetails.length + newChatOptions.recentReports.length + participants.length!== 0,

@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Jul 25, 2023

@StanislavLavrenchuk I think your solution will break other error handling , for example if we type a wrong email address it will not display any error

Actual Proposal result
Screenshot 2023-07-25 at 1 58 26 PM Screenshot 2023-07-25 at 1 57 55 PM

@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 14, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Split bill - 'No results found' appears after selecting the user in split bill member search [HOLD for payment 2023-08-21] [$1000] Split bill - 'No results found' appears after selecting the user in split bill member search Aug 14, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 14, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.53-2 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-08-21. 🎊

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 Aug 14, 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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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.
  • [@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Aug 17, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-08-21] [$1000] Split bill - 'No results found' appears after selecting the user in split bill member search [HOLD for payment 2023-08-24] [HOLD for payment 2023-08-21] [$1000] Split bill - 'No results found' appears after selecting the user in split bill member search Aug 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.54-13 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-08-24. 🎊

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 Aug 17, 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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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.
  • [@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/312293

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Aug 21, 2023
@luckyman0305
Copy link
Contributor

Hello.
Can I get payment today or later?

@fedirjh
Copy link
Contributor

fedirjh commented Aug 22, 2023

Can I get payment today or later?

I think the right payment date is 2023-08-24.

@melvin-bot melvin-bot bot added the Overdue label Aug 24, 2023
@luckyman0305
Copy link
Contributor

luckyman0305 commented Aug 24, 2023

@madmax330 @mallenexpensify I am waiting to get payment today.

@melvin-bot melvin-bot bot removed the Overdue label Aug 24, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Aug 24, 2023

BugZero Checklist:

  • Link to the PR: This does not look like a regression, It was not implemented in the past.
  • Link to comment: N/A
  • Link to discussion: N/A Nothing to add to the checklist.
  • Determine if we should create a regression test for this bug: ✅

Regression Test Proposal

  1. Open the App
  2. Click + icon > Split bill > Enter amount > Next.
  3. Type an email address
  4. Select the member in the search result
  5. Verify No results found does not appear

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

@madmax330, @mallenexpensify, @fedirjh, @luckyman0305 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@luckyman0305
Copy link
Contributor

I am waiting payment

@melvin-bot melvin-bot bot removed the Overdue label Aug 28, 2023
@madmax330
Copy link
Contributor

@mallenexpensify can you handle the payment 🙏🏽

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Aug 29, 2023

Sorry for the delay, I was OOO a few days.

Issue reporter: Applause
Contributor: @luckyman0305 , paid $1000 via Upwork
Contributor+: @fedirjh paid $1000 via Upwork

@luckyman0305 , I hired you, can you please accept the job and reply here once you have?
(I'm assuming you're Ben G from the UK).

@luckyman0305
Copy link
Contributor

image
Thanks

@mallenexpensify
Copy link
Contributor

Updated above, posting here too
Issue reporter: Applause
Contributor: @luckyman0305 , paid $1000 via Upwork
Contributor+: @fedirjh paid $1000 via Upwork

Thanks @luckyman0305 and @fedirjh
Testrail update GH is here

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

7 participants