Skip to content

[$250] Crash: Invariant Violation in VirtualizedList._createRenderMask in ReportActionsList on iOS #90957

@mountiny

Description

@mountiny

Description

A recurring crash is occurring on iOS in the ReportActionsList component. VirtualizedList._createRenderMask receives an invalid cell range [0, -4] (negative end index), causing an invariant violation.

Sentry issue: https://expensify.sentry.io/issues/APP-6DB
Example event: https://expensify.sentry.io/issues/7290255649/events/6ea8f8a9ccb5478a875afbf95576a8d9/

Impact:

  • 40,334 occurrences since first seen (2026-02-25)
  • 18,801 users impacted
  • Still ongoing as of 2026-05-18
  • Affects HybridApp iOS builds (new.expensify@9.3.61-4)

Error

Invariant Violation: Invalid cells around viewport "[0, -4]" was passed to VirtualizedList._createRenderMask

Component Stack

VirtualizedList
  FlatList
    CustomFlatList
      BaseFlatListWithScrollKey
        FlatListWithScrollKey
          MoneyRequestReportActionsList
            ReportActionsList
              ReportScreen

Analysis

The [0, -4] value suggests that VirtualizedList is being passed props that result in a negative cell index being computed for the viewport render mask. The most likely causes are:

  • An invalid or negative initialScrollIndex prop being passed to the FlatList in MoneyRequestReportActionsList or ReportActionsList
  • A race condition where the list data changes (shrinks) while an initial scroll offset computed from a larger dataset is still being applied
  • The getItemCount or item layout calculations returning values inconsistent with the actual data length

Steps to Investigate

  1. Review MoneyRequestReportActionsList and ReportActionsList for how initialScrollIndex is calculated and whether it can ever produce a value larger than the current item count
  2. Check if there is any case where the item list shrinks between when the scroll index is computed and when the list renders
  3. Verify that getItemLayout (if used) returns consistent values with the data array length
  4. Add a guard to clamp initialScrollIndex to Math.max(0, Math.min(index, data.length - 1)) as a defensive fix

Environment

  • Platform: iOS (HybridApp)
  • Device: iPhone14,6 (iPhone SE 3rd gen)
  • OS: iOS 26.4.2
  • Release: new.expensify@9.3.61-4
  • Build type: hybrid_app
Issue OwnerCurrent Issue Owner: @WojtekBoman
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022056337409756110816
  • Upwork Job ID: 2056337409756110816
  • Last Price Increase: 2026-05-18

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type
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