-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA] Only load full policies one-by-one as needed #6087
Conversation
Something I missed in this implementation – the |
I went ahead and addressed this and moved the |
Updated and ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chatted with Rory 1:1 and suggested the following changes:
- Change
API.getPolicyList()
to only accept a single string argument forpolicyID
and throw otherwise (this will remove the need to have a log) - Change the HOC so that it passes the policy object to the consumers (this is a more typical pattern for an HOC so it would make it more consistent)
- Make sure the only pages that need the policy object are the ones using the HOC
PR has been updated per @tgolen's comment above ^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. Just this one thing I noticed.
You got conflicts |
Looking good overall, but there's a conflict! |
Conflicts resolved! |
.then((data) => { | ||
if (data.jsonCode === 200) { | ||
const policy = data.policyList[0] || {}; | ||
const policy = lodashGet(data, 'policyList[0]', {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL: Did not know this worked, thought you had to do lodashGet(data, ['policyList', 0], {});
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @AndrewGable in version: 1.1.15-15 🚀
|
Details
So we want to make sure that whenever a workspace or any of its sub-pages attempts to render, then we'll load the full policy for that workspace. So whenever we navigate to a workspace page (and did not just come from one), then we'll load that full policy.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/181676
Tests
/settings
. Verify using logs or the network console that no full policy is loaded.x
to close the modal. Verify that the full settings modal closes.QA Steps
Only regression tests.
Tested On