Skip to content

[Due for payment 2026-04-23] [$250] Cmd+K search misses workspace members and blocks selection during loading #87035

@MelvinBot

Description

@MelvinBot

Slack thread: https://expensify.slack.com/archives/C05LX9D6E07/p1775170058986479

Bug 1: Cmd+K fails to show workspace members you haven't recently chatted with

Expected: When searching Cmd+K, workspace members should always appear in results immediately from locally cached personalDetails.

Actual: Sometimes searching for a workspace member you haven't chatted with recently returns other results instead. After ~300ms, the server search backfills and the person appears — but they should have been found locally.

Root cause analysis

Frontend — hard cap of 20 results starves personalDetails slots:

getValidOptions (src/libs/OptionsListUtils/index.ts) calculates:

maxPersonalDetailsElements = Math.max(20 - recentReportOptions.length - workspaceChats.length - ..., 0)

If the search term matches 20+ reports, zero personalDetails slots remain. A workspace member with no existing DM report only exists in the personalDetails list and becomes completely invisible. The server search then returns their DM report 300ms later, making them appear — exactly matching the reported behavior.

Additional contributing factors:

  • Asymmetric search fields — report search checks report.text + report.login, while personalDetail search also checks displayName and login-without-domain. A name match on personalDetails can be invisible if report search consumed all 20 slots.
  • Over-aggressive deduplicationfilteredPersonalDetailsOfRecentReports removes personalDetails entries sharing a login with any recent report, even if that report didn't match the search query.

Backend — OpenApp personalDetails query can miss workspace members:

The OpenApp command builds personalDetails via a UNION query (Account::runPersonalDetailsQuery). This can miss members when:

  1. disableAttendeeList filter — policies with this setting exclude ALL their members from the personalDetails response.
  2. Race condition with new members — if a member was just added and the sharedNameValuePairs row hasn't propagated, they're missing.
  3. Parallel thread failurescollectSearchTodosData runs in parallel threads merging into personalDetailsList, with catch blocks that silently swallow exceptions.

Bug 2: Cannot select a Cmd+K result until the loading spinner finishes

Expected: When a search result appears in Cmd+K, it should be immediately selectable.

Actual: After finding a chat in Cmd+K results, the user cannot select it until a loading spinner completes. This creates unnecessary friction — if the result is already displayed, it should be interactive.

Platforms

All platforms (Cmd+K / Ctrl+K search).

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022041502286489838422
  • Upwork Job ID: 2041502286489838422
  • Last Price Increase: 2026-04-07

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 contributorInternalRequires API changes or must be handled by Expensify staff

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions