Skip to content

[Due for payment 2026-07-08] [$250] [Performance] Investigate SendMessage metric improvements in chats with many MoneyRequestReportPreview #93771

Description

@mountiny

Problem

When a report's action list contains common actions other than ADD_COMMENT — most notably money-request previews (MoneyRequestReportPreview) — sending a new message triggers more ReportActionItem child rerenders than necessary.
A plain ADD_COMMENT action item is relatively cheap and largely stable. But preview-style action items subscribe to additional Onyx data (the linked IOU/expense report, transactions, metadata) and do heavier work to render.

When ManualSendMessage fires, those items rerender even though their own underlying data did not change — so the per-send cost scales with how many expenses/previews the list already contains, not with the message being sent.
This is the inverse of the ADD_COMMENT stability work already done: those paths were stabilized, but the non-ADD_COMMENT action items have not received the same treatment.

Lead: #77176 (comment) — "Add multiple expenses in chat (MoneyRequestReportPreview) and send a message. We should reduce time spent on these rerenders. Maybe we could reuse getStableReportSelector."

Proposed direction

  1. Build a report with multiple expenses (so the list holds several MoneyRequestReportPreview items), profile a ManualSendMessage, and capture which ReportActionItem children rerender and why.
  2. For non-ADD_COMMENT item type, find the Onyx subscriptions that re-emit on every message/read but whose churning fields the subtree never reads.
  3. Try to stabilize it, replace any whole-collection or unselected REPORT/related subscriptions with scoped, selector-backed ones. Check memoization and decomposition opportunities.
Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

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 contributorOverdue

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
CRITICAL

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions