Skip to content

[Due for payment 2026-08-27] Lazy-load contact options: shell first, createOption after getValidOptions #97788

Closed

Description

@mountiny

Problem

On large accounts, the contact option list is built eagerly: a full createOption is constructed for every personal detail, which pulls in policy, tag, and archive lookups plus icon building. Most of those options are then thrown away by filtering and top-N ranking, so the bulk of that work is wasted and shows up as a long blocking cost in flows like ParticipantSearchResults / createFilteredOptionList.

Solution

Adds an opt-in lazyContactOptions path for flows that run contacts through getValidOptions. Contacts are first built as lightweight shells via createLazyContactOption (only the fields needed to filter and rank — text, login, accountID, participantsList), with policy/tag/archive lookups and the full createOption work deferred into buildFullOption. getValidOptions then hydrates only the contacts that survive top-N selection via hydrateLazyContactOptions, so full option work happens once per visible match instead of once per contact. useSearchSelector enables the flag; all other callers keep the eager behavior. Measured createFilteredOptionList improvement: ~900ms → ~700ms.

PR

#97087

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. melvin-bot commented on Aug 7, 2026

    @melvin-bot

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

  2. shubham1206agra commented on Aug 8, 2026

    @shubham1206agra
    Contributor

    PR in draft

  3. melvin-bot commented on Aug 11, 2026

    @melvin-bot

    @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!

  4. 9 remaining items

  5. melvin-bot commented on Aug 20, 2026

    @melvin-bot

    @shubham1206agra

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.56-3 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-08-27. 🎊

    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]

  6. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  7. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  8. mallenexpensify commented on Aug 27, 2026

    @mallenexpensify
    Contributor

    No review checklist from @shubham1206agra so I'm assuming payment isn't due, comment/reopen if ya disagree

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 productionDailyKSv2ReviewingHas a PR in reviewTask

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions