-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewHas a PR in review
Description
This is coming from #27262. You can read the issue description there to get context behind the problem being solved and the mess being cleaned up.
Problem
ReportUtils.getPolicy() is called from a view component 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 policy data, then it needs to subscribe to the policy in Onyx so that it's garaunteed that the data will never be stale or out-of-date.
Solution
- Use
withOnyx()to load the data in view components - Use
Onyx.connect()to load the data in other action files - Remove the usage of
ReportUtils.getPolicy()or at least prevent it from being exported by adding a test to https://github.com/Expensify/App/blob/main/tests/actions/EnforceActionExportRestrictions.ts
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~010ae8bb081ab888f1
- Upwork Job ID: 1772360821776945152
- Last Price Increase: 2024-03-25
- Automatic offers:
- DylanDylann | Contributor | 0
Issue Owner
Current Issue Owner: @CortneyOfstadReactions are currently unavailable
Metadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewHas a PR in review