Skip to content

[$250] [HOLD for payment 2024-08-09] Avoid calling getOrderedReportIDs on mobile #46291

Description

@hurali97

Description:

This issue is part of investigations rooted from this slack thread. Amongst our findings, we discovered that getOrderedReportIDs is being called a lot of times and each call to this function is really expensive. Upon investigation, it occurred to us that the number of calls to getOrderedReportIDs is legit based on the actions. For eg, consider a case where we open a report which has expenses, click on a expense, it opens the expenses list, clicking on one expense, navigates us to the detail. Now, navigate back until you're on LHN. This is roughly 6-7 steps and we have useReportID being re-rendered 6-7 times for this set of actions because of the currentReportID being changed, which seems the correct behaviour.

Now, if we can reduce the impact of this re-render by not re-calculating getOrderedReportIDs function on mobile devices because in the above case, while we are on web and desktop, we attach an item in LHN when we click on an expense, which happens because we re-calculate getOrderedReportIDs each time the currentReportID changes if it's not already calculated. Also, when we navigate away from that new LHN item it is removed from the LHN.

Now, on mobile this is not important because when we click on an expense from ReportScreen, we are navigating to another screen, so LHN is never displayed and we don't need bother re-calculating getOrderedReportIDs on mobile.

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0133e161250d414c82
  • Upwork Job ID: 1825736030332418485
  • Last Price Increase: 2024-08-20

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions