Skip to content

[Due for payment 2026-06-18] [HOLD] Start chat - All contacts load instead of 50 contacts per page #86089

Closed

Description

@jponikarchuk

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.3.42-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #75026
Email or phone of affected tester (no customers): applausetester+jsodijsdnodjsi@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account that has more than 50 contacts.
  1. Go to staging.new.expensify.com
  2. Open FAB > Start chat.
  3. Scroll down the contact list.

Expected Result:

The first 50 contacts will load, then the next 50 contacts will load when scrolled down.

Actual Result:

All contacts load. There is no pagination.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @dukenv0307

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 23, 2026
  2. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #75026

  3. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Mar 23, 2026

    @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.
  5. OSBotify commented on Mar 23, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #75026 - "use useSearchSelector hook and remove unused and duplicated code" by @mkzie2 (High confidence)
    Related Issues: #74239 (regression test that should have caught this)

    Recommendation: ROLL FORWARD

    The fix is straightforward - UserSelectPopup needs to pass includeRecentReports: false to useSearchSelector. Rolling forward with a simple one-line fix is faster and safer than reverting this large refactoring PR that touches multiple files and has other dependent changes.

    Labels: No label changes needed - keeping DeployBlockerCash as this is a frontend bug in the App repository.

    📋 Detailed Analysis

    Evidence

    PR #75026 was merged on March 20, 2026 and is part of the current staging deploy (9.3.42-0). The bug is reproducible only on staging, not production, confirming it was introduced in this deploy cycle.

    The PR refactored UserSelectPopup to use the new useSearchSelector hook instead of the old usePersonalDetailOptions hook. While the refactoring was well-intentioned to reduce code duplication, it inadvertently changed the behavior of the "Start chat" contact list pagination.

    Verification

    Affected file: /home/runner/_work/App/App/src/components/Search/FilterDropdowns/UserSelectPopup.tsx

    Before PR #75026:

    • Used usePersonalDetailOptions hook
    • Called memoizedGetValidOptions with explicit includeRecentReports: false
    • Personal details were properly paginated (50 contacts per page)

    After PR #75026:

    • Uses useSearchSelector hook
    • Does NOT pass includeRecentReports parameter
    • Defaults to includeRecentReports: true (via line 276 in useSearchSelector.base.ts)
    • This breaks pagination behavior - all contacts load at once

    Root Cause

    In useSearchSelector.base.ts line 276, when using SEARCH_CONTEXT_GENERAL:

    includeRecentReports: !shouldAllowNameOnlyOptions,

    Since shouldAllowNameOnlyOptions defaults to false, this evaluates to includeRecentReports: true.

    However, UserSelectPopup (used for "Start chat") should NOT include recent reports - it should only show personal details (contacts). The old code explicitly set includeRecentReports: false.

    When includeRecentReports: true, the code path in getValidOptions changes how it calculates pagination, and in this specific case, it causes all contacts to load instead of paginating properly.

    Fix

    Add one line to UserSelectPopup.tsx at line 79:

    includeRecentReports: false,

    This matches the original behavior before the refactoring and will restore proper pagination of the contact list.

  6. MelvinBot commented on Mar 23, 2026

    @MelvinBot
    Contributor

    Proposal

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

    In the "Start chat" flow (FAB > Start chat), all contacts load at once instead of loading 50 contacts per page with more loading on scroll. This is reproducible in staging (v9.3.42-0) but not in production.

    What is the root cause of that problem?

    The root cause is PR #84887 ("Reapply: Make NewChatPage use new SelectionListWithSections"), not PR #75026 as initially suspected.

    The old SelectionListWithSections component (at src/components/SelectionListWithSections/) had built-in data-level pagination using slicedSections and MAX_SELECTION_LIST_PAGE_LENGTH = 50:

    The new SelectionListWithSections component (at src/components/SelectionList/SelectionListWithSections/) is FlashList-based and has no such pagination. It passes ALL flattenedData directly to FlashList (BaseSelectionListWithSections.tsx:384-410).

    PR #84887 (merged March 20) migrated NewChatPage from the old component to the new one. Production still uses the old component (with 50-at-a-time pagination); staging uses the new one (without pagination). This perfectly explains the staging-only reproduction.

    Timeline: PR #81869 (original migration, March 2) → PR #84068 (reverted due to group chat freeze, March 3) → PR #84887 (reapplied with FlashList patch, March 20).

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

    Add data-level pagination to the new BaseSelectionListWithSections component (src/components/SelectionList/SelectionListWithSections/BaseSelectionListWithSections.tsx) that mirrors the old component's behavior:

    1. Add currentPage state and slicedSections/slicedData logic that limits the flattenedData passed to FlashList to MAX_SELECTION_LIST_PAGE_LENGTH * currentPage items
    2. In the onEndReached handler, call incrementPage (in addition to the existing onEndReached prop) to progressively load more items
    3. This restores the 50-at-a-time loading behavior while still benefiting from the FlashList migration

    What alternative solutions did you explore? (Optional)

    • Accept FlashList virtualization as equivalent: FlashList already virtualizes rendering (only renders visible items), so the scrollbar reflecting all items may be acceptable. However, this changes the user-perceived behavior and was flagged as a deploy blocker.
    • Add pagination in NewChatPage itself: Pass maxElements to getValidOptions and implement onEndReached at the page level. This would be more targeted but would only fix NewChatPage — other pages migrated to the new SelectionListWithSections would have the same issue.

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. sharabai commented on Mar 23, 2026

    @sharabai
    Contributor

    TL;DR

    Pagination was purely visual. All of the data was already precomputed beforehand and pagination wasn't really doing anything aside from providing visual effect of 'loading more'.

    Detailed Explanation

    Meaning, it all of data was already calculated before and sent to the old SelectionListWithSections component.
    SelectionListWithSections did pagination with that data.
    That was horrible on many levels:
    You see pagination, you expect it to be an actual pagination. It wasn't. The new component doesn't have this logic that would introduce confusion and hide bad performance practices behind performative pagination.
    This should be handled imo at the level of components that use SelectionListWithSections and with the correct usage of 'handleEndReached'.
    This would entail refactor of the logic inside the NewChatPage.tsx that creates data.

    Proposed solutions

    Do refactor of the code that creates the data that is passed to the list.

  8. ZhenjaHorbach commented on Mar 23, 2026

    @ZhenjaHorbach
    Contributor

    I think it's not a deploy blocker
    Since it doesn't affect the user experience

  9. 95 remaining items

  10. melvin-bot commented on Jun 11, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.5-6 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 2026-06-18. 🎊

    For reference, here are some details about the assignees on this issue:

    • @zfurtak does not require payment (Contractor)
    • @sharabai does not require payment (Contractor)
    • @dukenv0307 does not require payment (Contractor)
  11. changed the title [-][HOLD] Start chat - All contacts load instead of 50 contacts per page[/-] [+][Due for payment 2026-06-18] [HOLD] Start chat - All contacts load instead of 50 contacts per page[/+] on Jun 11, 2026
  12. melvin-bot commented on Jun 11, 2026

    @melvin-bot

    @NikkiWines @mallenexpensify @zfurtak / @sharabai / @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  13. melvin-bot commented on Jun 15, 2026

    @melvin-bot

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

  14. dukenv0307 commented on Jun 16, 2026

    @dukenv0307
    Contributor

    @sharabai this issue is done, right?

  15. sharabai commented on Jun 16, 2026

    @sharabai
    Contributor

    @dukenv0307, yep it's done.

  16. dukenv0307 commented on Jun 16, 2026

    @dukenv0307
    Contributor

    Since this issue is quite complex, I'd like to request to increase the bounty. Here are the details

    @NikkiWines can you please confirm?

  17. NikkiWines commented on Jun 16, 2026

    @NikkiWines
    Contributor

    @dukenv0307 yes, i think that's fine here 👍

  18. mallenexpensify commented on Jun 19, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dukenv0307 due $750 via NewDot

  19. quinthar commented on Jul 5, 2026

    @quinthar
    Contributor

    Approved $750 to @dukenv0307

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions