Skip to content

[$500] Chat - Incorrect search result & Show More' Dropdown shown when one search result displayed #37267

Closed

Description

@izarutskaya

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: 1.4.44-0
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+omq1@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal Team

Action Performed:

Precondition: user Signed In with expensifail account

  1. Tap on FAB
  2. Tap on "Start Chat"
  3. Search for any user e.g. "omp1"
  4. Tap on "Show More" dropdown button

Expected Result:

The search result page should be properly displayed

Actual Result:

Incorrect search result counter and "Show More' Dropdown button shown when one search result displayed. When the user taps on the 'Show More' button, nothing happens.

Workaround:

Unknown

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

Bug6393599_1709009871871.RPReplay_Final1708998854.mp4

Bug6393599_1709009871881!IMG_9313C8D679EC-1

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0113928963c9c991f9
  • Upwork Job ID: 1762422673435533312
  • Last Price Increase: 2024-02-27

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 27, 2024
  2. melvin-bot commented on Feb 27, 2024

    @melvin-bot
  3. changed the title [-]Chat - Incorrect search result & Show More' Dropdown shown when one search result displayed[/-] [+][$500] Chat - Incorrect search result & Show More' Dropdown shown when one search result displayed[/+] on Feb 27, 2024
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 27, 2024
  5. melvin-bot commented on Feb 27, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 27, 2024

    @melvin-bot

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

  7. github-actions commented on Feb 27, 2024

    @github-actions
    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.
  8. melvin-bot commented on Feb 27, 2024

    @melvin-bot

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

  9. izarutskaya commented on Feb 27, 2024

    @izarutskaya
    Author

    We think that this bug might be related to #vip-vsb
    CC @quinthar

  10. benjaminbennet commented on Feb 27, 2024

    @benjaminbennet

    Proposal

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

    Incorrect search result & Show More' Dropdown shown when one search result displayed

    What is the root cause of that problem?

    Let's take a look here:

    export default memo(
    forwardRef(BaseOptionsList),
    (prevProps, nextProps) =>
    nextProps.focusedIndex === prevProps.focusedIndex &&
    nextProps?.selectedOptions?.length === prevProps?.selectedOptions?.length &&
    nextProps.headerMessage === prevProps.headerMessage &&
    nextProps.isLoading === prevProps.isLoading &&
    isEqual(nextProps.sections, prevProps.sections),
    );

    BaseOptionList only re-renders based on the above conditions. Because of that when renderFooterContent changed, BaseOptionList won't re-render. That's the root cause.

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

    Add a new props called shouldShowFooter to our BaseOptionsList. We should only render the footer when shouldShowFooter is true. Also update the condition inside memo function to include shouldShowFooter props.

    export default memo(
        forwardRef(BaseOptionsList),
        (prevProps, nextProps) =>
            nextProps.focusedIndex === prevProps.focusedIndex &&
            nextProps.shouldShowFooter === prevProps.shouldShowFooter &&
            nextProps?.selectedOptions?.length === prevProps?.selectedOptions?.length &&
            nextProps.headerMessage === prevProps.headerMessage &&
            nextProps.isLoading === prevProps.isLoading &&
            isEqual(nextProps.sections, prevProps.sections),
    );
    // BaseOptionsList component
    ListFooterComponent={shouldShowFooter && renderFooterContent}

    Finally update the BaseOptionsSelector component:

     shouldShowFooter={shouldShowShowMoreButton}
      renderFooterContent={() =>
                   
                        <ShowMoreButton
                            containerStyle={{...themeStyles.mt2, ...themeStyles.mb5}}
                            currentCount={CONST.MAX_OPTIONS_SELECTOR_PAGE_LENGTH * paginationPage}
                            totalCount={allOptions.length}
                            onPress={incrementPage}
                        />
                    
                }

    What alternative solutions did you explore? (Optional)

    N/A

  11. dukenv0307 commented on Feb 27, 2024

    @dukenv0307
    Contributor

    Proposal

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

    Incorrect search result counter and "Show More' Dropdown button shown when one search result displayed. When the user taps on the 'Show More' button, nothing happens.

    What is the root cause of that problem?

    This is the regression of this PR #31606, we pass the wrong sections prop into BaseOptionList that makes this component not re-render when the options is changed

    https://github.com/Expensify/App/pull/31606/files#diff-a9bb6f5b7c223e3c0a5f49b1a55692c74a63287a411527bbac37cabd95b2ffe2

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

    we should pass sections state here instead of props.sections

    sections={sections}
    

    What alternative solutions did you explore? (Optional)

    NA

  12. sobitneupane commented on Feb 27, 2024

    @sobitneupane
    Contributor

    I could not reproduce the issue.

    @dukenv0307 @benjaminbennet Is the issue still reproducible? If yes, Can you please share the steps to reproduce the issue?

  13. puneetlath commented on Feb 27, 2024

    @puneetlath
    Contributor

    I'm also not able to reproduce. Going to close, but feel free to comment if you're able to reproduce it.

  14. melvin-bot commented on Feb 28, 2024

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions