This is coming from #27262. You can read the issue description there to get the context behind the problem being solved and the mess being cleaned up.
Problem
ReportActionUtils.getAllReportActions() is called from several view components and other action files which is an anti-pattern.
Why this is important to fix
It maintains a more pure and exact flow of data through the react application. If the view is using report action data, then it needs to subscribe to the data in Onyx so that it's guaranteed that the data will never be stale or out-of-date.
Solution
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01944da5c2a9fee46a
- Upwork Job ID: 1773061588854910976
- Last Price Increase: 2024-04-17
- Automatic offers:
- Ollyws | Reviewer | 0
- godofoutcasts94 | Contributor | 0
Issue Owner
Current Issue Owner: @bfitzexpensify
This is coming from #27262. You can read the issue description there to get the context behind the problem being solved and the mess being cleaned up.
Problem
ReportActionUtils.getAllReportActions()is called from several view components and other action files which is an anti-pattern.Why this is important to fix
It maintains a more pure and exact flow of data through the react application. If the view is using report action data, then it needs to subscribe to the data in Onyx so that it's guaranteed that the data will never be stale or out-of-date.
Solution
withOnyx()to load the data in view componentsOnyx.connect()to load the data in other action filesReportUtils.getAllReportActions()or at least prevent it from being exported by adding a test to https://github.com/Expensify/App/blob/main/tests/actions/EnforceActionExportRestrictions.tsUpwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @bfitzexpensify