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-30] [HOLD for payment 2023-10-27] [$500] New user disappears from search results when selected #29917

Closed
6 tasks done
thienlnam opened this issue Oct 18, 2023 · 42 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

@thienlnam
Copy link
Contributor

thienlnam commented Oct 18, 2023

Follow up from #29903

Action Performed:

Break down in numbered steps

  1. From the FAB, select 'Send Message'
  2. With a couple participants, choose 'Add to Group'
  3. Search for a user you have not chatted with
  4. Choose 'Add to Group'

Expected Result:

The option should not disappear when you choose 'Add to Group'

Actual Result:

When choose to group is selected, the option disappears from the search results

Workaround:

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

Yes, you can still remove the search to show all the selected participants

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
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e7a262c69c9017a0
  • Upwork Job ID: 1714778082557702144
  • Last Price Increase: 2023-10-18
Issue OwnerCurrent Issue Owner: @anmurali
@thienlnam thienlnam added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 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

@thienlnam
Copy link
Contributor Author

This is a follow up from a PR I created that we're rushing due to urgency for the activation, I'm waiting till it's merged before adding the external label

@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 New user disappears from search results when selected [$500] New user disappears from search results when selected Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01e7a262c69c9017a0

@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

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

@neonbhai
Copy link
Contributor

neonbhai commented Oct 19, 2023

Proposal

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

New user disappears from search results when selected

What is the root cause of that problem?

This happens as new user is not returned from getFilteredOptions if it is already a selectedOption here:

_.every(selectedOptions, (option) => option.login !== searchValue) &&

It is not sent as part of any other section as since no report is created yet, the app officially does not 'know' this user

const noOptions = recentReportOptions.length + personalDetailsOptions.length === 0 && !currentUserOption;
const noOptionsMatchExactly = !_.find(
personalDetailsOptions.concat(recentReportOptions),
(option) => option.login === addSMSDomainIfPhoneNumber(searchValue).toLowerCase() || option.login === searchValue.toLowerCase(),
);

So it not a part of recentReports or personalDetailsList

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

We should return a result of searching selectedOptions from getOptions(). Since the pattern is going to be implemented for all selectors, this makes things neat. We can show the searched selected options when the searchTerm is not empty.

We will perform a search here:

if (!includeSelectedOptions || searchInputValue === '') {

then exclude selectedOptions from other search results.

The returned selected options result will go in the else block for this (will be shown when searchTerm is not empty):

What alternative solutions did you explore? (Optional)

The selectedOptions should be searched inside the MoneyRequestParticipants page, instead of getOptions().

When searchTerm is not empty, in the else block for this:

We will filter participants according to participant.searchText.includes(searchTerm)

else {
    // filter logic:
    const searchedParticipants = _.filter(participants, (participant) => participant.searchText.includes(searchTerm));
    
    // push the searched participants into the list. We only change data to map searchedParticipants.
    newSections.push({
        title: undefined,
        data: _.map(searchedParticipants, (participant) => {
            const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
            return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);
        }),
        shouldShow: true,
        indexOffset,
    });
    indexOffset += searchedParticipants.length;
}

@tjbo
Copy link

tjbo commented Oct 19, 2023

Proposal

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

When we search for a new user, and click add to group, the user disappears.

What is the root cause of that problem?



On line 75 of NewChatPage.js we are purposely omitting the selected users section unless the search term is empty.


  // Only show the selected participants if the search is empty
        if (searchTerm === '') {
            sectionsList.push({
                title: undefined,
                data: selectedOptions,
                shouldShow: !_.isEmpty(selectedOptions),
                indexOffset,
            });
            indexOffset += selectedOptions.length;
        }

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

Remove the if statement that prevents selected users from being shown.

With these changes it functions like this, keeping the list consistent with visible feedback for the user across selection tasks.

thething.mov

What alternative solutions did you explore? (Optional)

I also explored changing the title of the list to "Add Users to Group Chat", instead of undefined.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 19, 2023

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 @thienlnam In my original proposal for #29836, I've already included the solution for this issue. I'm assuming I could have first dibs in this issue once I bring that same proposal here (@neonbhai 's proposal is similar), since my fix was essentially first, just that it wasn't implemented during the PR process for that issue.

Do you think that's reasonable?

@thienlnam
Copy link
Contributor Author

Your previous solution doesn't really outline the root cause of this problem, and because I used pieces of your proposal we're compensating you in the previous issue. Though I do think you should handle #29916 since you originally mentioned that in your proposal. Does that sound good?

Also, since we're dealing with urgency for these specific issues it is hard with the different time zone to get on it at the same time

@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

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

@thienlnam
Copy link
Contributor Author

I'm looking into this one with @abdulrahuman5196

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-27] [$500] New user disappears from search results when selected [HOLD for payment 2023-10-30] [HOLD for payment 2023-10-27] [$500] New user disappears from search results when selected Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 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-30. 🎊

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 23, 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:

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

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

@anmurali
Copy link

Approved for @allroundexperts to be paid $500 for this PR via New Dot.

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

$500 payment approved for @allroundexperts based on comment above.

Copy link

melvin-bot bot commented Nov 6, 2023

@anmurali, @allroundexperts, @thienlnam Huh... This is 4 days overdue. Who can take care of this?

@thienlnam
Copy link
Contributor Author

Looks like all that is left here is a partial payment to @neonbhai cc @anmurali

Context here: #29917 (comment)

I've been doing 50% payments for these situations, so that would be $250

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 7, 2023
Copy link

melvin-bot bot commented Nov 10, 2023

@anmurali, @allroundexperts, @thienlnam Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Nov 10, 2023

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

@anmurali
Copy link

@neonbhai - sent you an offer for partial payment here

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2023
@neonbhai
Copy link
Contributor

@anmurali offer accepted. Thank you!

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

melvin-bot bot commented Nov 21, 2023

@anmurali, @allroundexperts, @thienlnam Still overdue 6 days?! Let's take care of this!

@thienlnam
Copy link
Contributor Author

cc @anmurali Issue just pending payout now

Copy link

melvin-bot bot commented Nov 23, 2023

@anmurali, @allroundexperts, @thienlnam Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

Copy link

melvin-bot bot commented Nov 27, 2023

@anmurali, @allroundexperts, @thienlnam 12 days overdue now... This issue's end is nigh!

@anmurali
Copy link

Paid.

@melvin-bot melvin-bot bot removed the Overdue label Nov 29, 2023
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