Skip to content

Update how we handle optimistic report data in OpenReport #60712

Description

@mountiny

Coming from here

Background:

Our expense reporting system serves users with varying amounts of data. Large accounts can have hundreds of expense entries that need to be displayed when opening a report. The current system uses a loading process that includes retrieving data, processing it, and rendering it to the UI. The application uses an optimistic UI pattern that attempts to show data as quickly as possible, with visual indicators appearing when data is being fetched or processed.

Problem:

When users with large amounts of data open expense reports, some of them briefly see their data before it disappears and is replaced by either a skeleton loader or an empty state component, which prevents them from working efficiently with their expense information.

Solution:

We will modify the openReport method to maintain the complete report object state throughout the loading process. Specifically, we will remove the conditional logic in openReport that currently creates different versions of optimisticReport depending on whether the report has actions so we’ll always populate optimisticReport with all existing report data from Onyx, regardless of the presence of actions.

Issue OwnerCurrent Issue Owner: @martasudol

Metadata

Metadata

Labels

AutoAssignerNewDotQualityUsed to assign quality issues to engineersBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ReviewingHas a PR in review

Type

No type

Fields

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