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] Remove the selected participants from the search results in the split / group chat flow #29836

Closed
6 tasks
thienlnam opened this issue Oct 17, 2023 · 26 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 External Added to denote the issue can be worked on by a contributor

Comments

@thienlnam
Copy link
Contributor

thienlnam commented Oct 17, 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!


Version Number: Version 1.3.83-1 (1.3.83-1)
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
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation: https://expensify.slack.com/archives/C05RECHFBEW/p1697553482299739

Action Performed:

Break down in numbered steps

  1. From the global create menu, send a message or request money
  2. Select a bunch of participants and then search for a user that is not in the list

Expected Result:

When you start searching, the selected participants should not show up unless they are part of the search results.
When the search text is empty, the selected participants should show up again

Actual Result:

Selected participants are always in the option list

Workaround:

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

Yes, but it's confusing on smaller screens

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

https://files.slack.com/files-pri/T047TPA624F-F061DSHBHAS/screenshot_2023-10-17_at_3.55.35_pm.png

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016fdba16a8b2fba60
  • Upwork Job ID: 1714445993688682496
  • Last Price Increase: 2023-10-18
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 27519943
    • dukenv0307 | Contributor | 27519945
@thienlnam thienlnam added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 17, 2023
@melvin-bot

This comment was marked as off-topic.

@melvin-bot

This comment was marked as off-topic.

@thienlnam
Copy link
Contributor Author

Waiting to add external until we confirm this is the desired functionality https://expensify.slack.com/archives/C05RECHFBEW/p1697553482299739

@neonbhai
Copy link
Contributor

neonbhai commented Oct 17, 2023

Proposal

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

Remove the selected participants from the search results in the split / group chat flow

What is the root cause of that problem?

We always pass selected participants to the options selector here:

newSections.push({
title: undefined,
data: _.map(participants, (participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);
}),
shouldShow: true,
indexOffset,
});

Once selected, the option will always appear.
We have to make sure the selected participants react to the searchTerm.

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

We need to:

  • Show selected participants on top of list when search is empty. We will exclude them from other sections
  • When search is not empty we want to also search the selectedParticipants (and show them on top of the list)

We will be modifying the behaviour of the this section to filter according to searchTerm:

newSections.push({
title: undefined,
data: _.map(participants, (participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);
}),
shouldShow: true,
indexOffset,
});

We will filter out participants when searchTerm is not empty.

data: _.chain(participants)
        .filter((participant) => searchTerm === '' || participant.searchText.includes(searchTerm))
        .map((participant) => { 
            const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
            return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);       
        })
        .value(),

Before mapping the participants, we will filter them by checking the presence of searchTerm in searchText key for participants.

Result:

Screencast.from.18-10-23.07.38.24.AM.IST.webm

@thienlnam thienlnam added the External Added to denote the issue can be worked on by a contributor label Oct 18, 2023
@melvin-bot melvin-bot bot changed the title Remove the selected participants from the search results in the split / group chat flow [$500] Remove the selected participants from the search results in the split / group chat flow Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016fdba16a8b2fba60

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

melvin-bot bot commented Oct 18, 2023

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

@thienlnam
Copy link
Contributor Author

As a reminder, we still want to show the selected participant if they show up as part of the search results

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 18, 2023

Proposal

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

Selected participants are always in the option list, it should only show up it matching the search term, if there's no search term then all should show up.

What is the root cause of that problem?

In here, we're pushing in the list of participants regardless of the search results, so all the participants will show at all time.

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

  1. Replace this by [],, so the participants are not excluded from the search result.
  2. In here, if the search term is empty, we'll push the section of participants normally, otherwise we'll filter the list of participants in the search result newChatOptions and push it in the section instead. That means if there's search term, we'll only show participants that are contained in the search result
  3. In the sections below like this, we'll filter out the participants in data so we don't have a duplicate participant.

What alternative solutions did you explore? (Optional)

In 2, we can simplify by removing this part if the search term is empty, we'll push the section of participants normally, since all the participants are likely already in each of the newChatOptions list, so we'll filter the list of participants in the search result should also work well in the no-search-term case.

An alternative is to fix inside getFilteredOptions to have another section like filteredSelectedOptions which will contains the "selected options that match the search result", we'll not exclude the participants from the search result but push it in another section, with similar logic as above. And use a flag variable to control if we want this behavior when we use filteredSelectedOptions in different places, or we want to keep existing behavior of filtering out the selected options.

@abdulrahuman5196
Copy link
Contributor

@dukenv0307 's proposal here #29836 (comment) looks good and works well.

🎀 👀 🎀
C+ Reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

Current assignee @thienlnam is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@thienlnam
Copy link
Contributor Author

Due to the urgency on this - I'm going to take the PR so we can get it merged today, since I'm using part of Dukes solution we can do a partial payment since it appears to be 1am in your time

@melvin-bot melvin-bot bot changed the title [$500] Remove the selected participants from the search results in the split / group chat flow [HOLD for payment 2023-10-27] [$500] Remove the selected participants from the search results in the split / group chat flow 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 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

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:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] 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.
  • [@kevinksullivan] 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
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@danielrvidal, @kevinksullivan, @thienlnam, @abdulrahuman5196 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Not a regression. Implementation of new expectation.

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

Yes.

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.

  1. From the FAB, send a message or split bill
  2. On the participants selector, add a couple participants to the group / split
  3. Verify that you see them at the top
  4. Start searching for a user and verify the selected participants are gone
  5. Search for a user that you have selected and verify they show up in the search results
  6. Verify that when you search for something, the selected participants disappear unless they are part of the search results

@kevinksullivan

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 31, 2023
@danielrvidal
Copy link
Contributor

I think @kevinksullivan is off until next week so will get back to it then. I don't have test rail set up unfortunately so couldn't figure out where to put the tests.

@melvin-bot melvin-bot bot removed the Overdue label Nov 2, 2023
@dukenv0307
Copy link
Contributor

Due to the urgency on this - I'm going to take the PR so we can get it merged today, since I'm using part of Dukes solution we can do a partial payment since it appears to be 1am in your time

@thienlnam can you assign me to this issue for payment purpose, thanks!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 4, 2023
Copy link

melvin-bot bot commented Nov 4, 2023

📣 @abdulrahuman5196 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 4, 2023

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@thienlnam
Copy link
Contributor Author

Just a note here @kevinksullivan when you get back, this was a deploy blocker and required an urgent fix so I used part of @dukenv0307's solution and added it myself so that only requires a partial payment (I believe 50% is fair?)

And then full payment for the C+ that reviewed the PR

You may need to adjust the automated offers that were sent out

@dukenv0307
Copy link
Contributor

I used part of @dukenv0307's solution and added it myself so that only requires a partial payment (I believe 50% is fair?)

I'm good with this, thank you!

@kevinksullivan
Copy link
Contributor

@abdulrahuman5196 can you accept the offer in upwork? Lmk here once you've done so!

@kevinksullivan
Copy link
Contributor

Paid @dukenv0307

@abdulrahuman5196
Copy link
Contributor

@kevinksullivan accepted the offer

@melvin-bot melvin-bot bot added the Overdue label Nov 10, 2023
@kevinksullivan
Copy link
Contributor

all set

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants