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
- Build a report with multiple expenses (so the list holds several
MoneyRequestReportPreview items), profile a ManualSendMessage, and capture which ReportActionItem children rerender and why.
- 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.
- 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 Owner
Current Issue Owner: @mallenexpensify
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 moreReportActionItemchild rerenders than necessary.A plain
ADD_COMMENTaction 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
ManualSendMessagefires, 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_COMMENTstability work already done: those paths were stabilized, but the non-ADD_COMMENTaction 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 reusegetStableReportSelector."Proposed direction
MoneyRequestReportPreviewitems), profile aManualSendMessage, and capture whichReportActionItemchildren rerender and why.ADD_COMMENTitem type, find the Onyx subscriptions that re-emit on every message/read but whose churning fields the subtree never reads.REPORT/related subscriptions with scoped, selector-backed ones. Check memoization and decomposition opportunities.Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mallenexpensify