Skip to content

[Due for payment 2026-04-14] Expense report chat appears empty when report has 50+ IOU actions with newer comments #85647

@mountiny

Description

@mountiny

Description

When an expense report has 50+ IOU report actions (oldest) followed by comments/other report actions (newest), the chat area below the transaction table appears empty. The comments and other non-IOU actions exist but are never loaded because pagination fails.

Root Cause

  1. For money request reports, OpenReport explicitly uses ASC sort order (oldest first) — see Auth/auth/command/OpenReport.cpp line 278: reportActionSortOrder = ReportAction::SORT_ORDER_ASC
  2. The first page of 50 actions therefore contains the oldest actions: the CREATED action + IOU CREATE actions
  3. MoneyRequestReportActionsList filters ALL of these out via isActionVisibleOnMoneyRequestReport():
    • IOU actions with type === CREATE or TRACK are filtered out (they are shown in the transaction table at the top instead)
    • The CREATED report action is also filtered out by default
  4. visibleReportActions ends up empty — the FlatList's data array has zero items
  5. The newer comment/non-IOU actions exist on subsequent pages but onStartReached/onEndReached never fire because there are no data items to scroll through
  6. loadNewerChats() (which would fetch the newer comments) is never triggered

The pagination system relies entirely on scroll events from the FlatList. When the FlatList's data array is empty (because all fetched actions were filtered out), no scroll events fire, breaking the pagination loop. There is no fallback mechanism to detect this state and trigger additional page fetches.

Key Files

  • Auth/auth/command/OpenReport.cpp — line 278: explicitly sets SORT_ORDER_ASC for money request reports
  • src/libs/MoneyRequestReportUtils.tsisActionVisibleOnMoneyRequestReport() filters out IOU CREATE/TRACK actions and CREATED action (lines 34-53)
  • src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsxvisibleReportActions filter (lines 320-345), FlatList with data={visibleReportActions} (line 862)
  • src/hooks/useLoadReportActions.tsloadNewerChats() / loadOlderChats() are only triggered by scroll events (lines 90-151)
  • Auth/auth/lib/Report.cpp — page limit of 50 at line 616

Steps to Reproduce

  1. Create an expense report with 50+ individual expenses
  2. Add a few comments to the expense report (these will be chronologically newer than the IOU actions)
  3. Open the expense report in NewDot
  4. Observe that the transaction table shows expenses at the top, but the chat area below is completely empty — the comments are not loaded
  5. The comments exist on subsequent pages but pagination never triggers to fetch them

Expected Behavior

The chat area should show comments and other non-IOU report actions. The app should automatically paginate to load them even if the first page(s) contain only filtered-out IOU actions.

Actual Behavior

The chat area below the transaction table is completely empty. Comments and other report actions that exist on the report are not displayed.

Proposed Solution

Add a useEffect in MoneyRequestReportActionsList that detects when visibleReportActions is empty (or has too few items to fill the screen) while hasNewerActions is true, and automatically calls loadNewerChats(true) to fetch the next page. This should loop until visible actions appear or all pages are exhausted.

Platform

  • Web
  • iOS
  • Android
  • Desktop

All platforms are affected since this is a data loading issue in shared React code.

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

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