Skip to content

[Payment 2025-02-06] [$250] Search- New participant/email is shown as recent chat when found via search #53876

Closed

Description

@lanitochka17

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: 9.0.73-6
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: 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/5318978
Email or phone of affected tester (no customers): gatantm@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch the app logged in and tap on search
  2. Type an email never that you never chatted with

Expected Result:

The new email is shown on top without the recent chats header

Actual Result:

The new email is shown as part of the recent chats section although never talked to it before

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6690166_1733848545538.ScreenRecording_12-10-2024_18-31-12_1.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021870567347662440875
  • Upwork Job ID: 1870567347662440875
  • Last Price Increase: 2024-12-28
  • Automatic offers:
    • FitseTLT | Contributor | 105547307
Issue OwnerCurrent Issue Owner: @strepanier03

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 10, 2024
  2. melvin-bot commented on Dec 10, 2024

    @melvin-bot

    Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. FitseTLT commented on Dec 10, 2024

    @FitseTLT
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-12-10 17:49:25 UTC.

    Proposal

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

    Search- New participant/email is shown as recent chat when found via search

    What is the root cause of that problem?

    We are pushing userToInvite to report options list here

    if (filteredOptions.userToInvite) {
    reportOptions.push(filteredOptions.userToInvite);
    }

    and displaying it as part of recent chat section here
    const styledRecentReports = recentReportsOptions.map((item) => ({...item, pressableStyle: styles.br2, wrapperStyle: [styles.pr3, styles.pl3]}));
    sections.push({title: translate('search.recentChats'), data: styledRecentReports});

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

    We should display userToInvite on its own section so remove

    if (filteredOptions.userToInvite) {
    reportOptions.push(filteredOptions.userToInvite);
    }

    and push a new section with filteredOptions.userToInvite above here
    const styledRecentReports = recentReportsOptions.map((item) => ({...item, pressableStyle: styles.br2, wrapperStyle: [styles.pr3, styles.pl3]}));
    sections.push({title: translate('search.recentChats'), data: styledRecentReports});

      const [recentReportsOptions, userToInvite] = useMemo(() => {
            if (autocompleteQueryValue.trim() === '') {
                return [searchOptions.recentReports.slice(0, 20)];
            }
    
            Timing.start(CONST.TIMING.SEARCH_FILTER_OPTIONS);
            const filteredOptions = OptionsListUtils.filterOptions(searchOptions, autocompleteQueryValue, {sortByReportTypeInSearch: true, preferChatroomsOverThreads: true});
            Timing.end(CONST.TIMING.SEARCH_FILTER_OPTIONS);
            const userToInvite = [];
            const reportOptions: OptionData[] = [...filteredOptions.recentReports, ...filteredOptions.personalDetails];
            if (filteredOptions.userToInvite) {
                userToInvite.push(filteredOptions.userToInvite);
            }
            return [reportOptions.slice(0, 20), userToInvite];
        }, [autocompleteQueryValue, searchOptions]);
    
    if (userToInvite?.length) {
            const styledUserToInvite = userToInvite?.map((item) => ({...item, pressableStyle: styles.br2, wrapperStyle: [styles.pr3, styles.pl3]}));
    
            sections.push({title: undefined, data: styledUserToInvite});
        }
    
    

    If needed we can use another copy for the title section but it would be aligned with how we are treating userToInvite in WorkspaceInvitePage if we set the title undefined.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    What alternative solutions did you explore? (Optional)

    Alternatively we can also remove

    if (filteredOptions.userToInvite) {
    reportOptions.push(filteredOptions.userToInvite);
    }

    and then add this line of codes here

    if (filteredOptions.userToInvite) {
            const styledUserToInvite = [filteredOptions.userToInvite]?.map((item) => ({...item, pressableStyle: styles.br2, wrapperStyle: [styles.pr3, styles.pl3]}));
    
            sections.push({title: undefined, data: styledUserToInvite});
        }
    
    
  4. Tony-MK commented on Dec 10, 2024

    @Tony-MK
    Contributor

    Proposal

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

    Search- New participant/email is shown as a recent chat when found via search

    What is the root cause of that problem?

    The filteredOptions array includes users who are not invited and are unknown because we didn't specify the canInviteUser and excludeUnknownUsers props when calling the OptionsListUtils.filterOptions function to get the recentReportsOptions.

    const recentReportsOptions = useMemo(() => {
    if (autocompleteQueryValue.trim() === '') {
    return searchOptions.recentReports.slice(0, 20);
    }
    Timing.start(CONST.TIMING.SEARCH_FILTER_OPTIONS);
    const filteredOptions = OptionsListUtils.filterOptions(searchOptions, autocompleteQueryValue, {sortByReportTypeInSearch: true, preferChatroomsOverThreads: true});

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

    We should filter out some of the unknown users and users who have not been invited.

    We set the canInviteUser and excludeUnknownUsers props to false and true respectively as below.

    const filteredOptions = OptionsListUtils.filterOptions(searchOptions, autocompleteQueryValue, {sortByReportTypeInSearch: true, preferChatroomsOverThreads: true});

    const filteredOptions = OptionsListUtils.filterOptions(searchOptions, autocompleteQueryValue, {sortByReportTypeInSearch: true, preferChatroomsOverThreads: true, canInviteUser: false, excludeUnknownUsers : true});
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We can make tests to make sure that the recentReportsOptions have reports where a participant has started interacting with the current user.

    So, we will assert if new participant's email is in recentReportsOptions .

  5. melvin-bot commented on Dec 16, 2024

    @melvin-bot

    @strepanier03 Eep! 4 days overdue now. Issues have feelings too...

  6. melvin-bot commented on Dec 18, 2024

    @melvin-bot

    @strepanier03 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  7. melvin-bot commented on Dec 20, 2024

    @melvin-bot

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

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 21, 2024
  9. melvin-bot commented on Dec 21, 2024

    @melvin-bot
  10. changed the title [-]Search- New participant/email is shown as recent chat when found via search[/-] [+][$250] Search- New participant/email is shown as recent chat when found via search[/+] on Dec 21, 2024
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 21, 2024
  12. 79 remaining items

  13. strepanier03 commented on Feb 7, 2025

    @strepanier03
    Contributor

    @Ollyws - I'll check tomorrow for the checklist and reg test steps and then post the payment summary.

    @FitseTLT - I paid your contract in Upwork and closed the contract.

  14. Ollyws commented on Feb 7, 2025

    @Ollyws
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on both staging and production
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    1. Launch the app and tap on search
    2. type anything
    3. Verify the Recent chats header disappears once you type something
    

    Do we agree 👍 or 👎

  15. melvin-bot commented on Feb 10, 2025

    @melvin-bot

    @rlinoz, @strepanier03, @Ollyws, @FitseTLT Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. FitseTLT commented on Feb 10, 2025

    @FitseTLT
    Contributor

    @strepanier03 Payment overdue

  17. strepanier03 commented on Feb 11, 2025

    @strepanier03
    Contributor

    @FitseTLT - I paid your contract and closed it last week.

  18. strepanier03 commented on Feb 11, 2025

    @strepanier03
    Contributor

    @Ollyws payment summary below, feel free to request payment now.

  19. strepanier03 commented on Feb 11, 2025

    @strepanier03
    Contributor

    Payment Summary

  20. Ollyws commented on Feb 11, 2025

    @Ollyws
    Contributor

    Requested in ND.

  21. garrettmknight commented on Feb 11, 2025

    @garrettmknight
    Contributor

    $250 approved for @Ollyws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions