-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Refactor] onyx key user #8264
[Refactor] onyx key user #8264
Conversation
src/libs/actions/User.js
Outdated
@@ -113,7 +113,8 @@ function getUserDetails() { | |||
const loginList = _.where(response.loginList, {partnerName: 'expensify.com'}); | |||
const expensifyNewsStatus = lodashGet(response, 'account.subscribed', true); | |||
const validatedStatus = lodashGet(response, 'account.validated', false); | |||
Onyx.merge(ONYXKEYS.USER, {loginList, expensifyNewsStatus: !!expensifyNewsStatus, validated: !!validatedStatus}); | |||
Onyx.merge(ONYXKEYS.USER, {expensifyNewsStatus: !!expensifyNewsStatus, validated: !!validatedStatus}); | |||
Onyx.set(ONYXKEYS.USER_LOGIN_LIST, loginList); |
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.
Prefer merge. Not needed.
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.
Wouldn't that make our loginList grow in size with lots of repeat logins?
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.
Yeah, Correct. LodashMerge.....
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.
Let's get the screenshots of running app after login screen for each platform.
src/libs/actions/User.js
Outdated
@@ -113,7 +113,8 @@ function getUserDetails() { | |||
const loginList = _.where(response.loginList, {partnerName: 'expensify.com'}); | |||
const expensifyNewsStatus = lodashGet(response, 'account.subscribed', true); | |||
const validatedStatus = lodashGet(response, 'account.validated', false); | |||
Onyx.merge(ONYXKEYS.USER, {loginList, expensifyNewsStatus: !!expensifyNewsStatus, validated: !!validatedStatus}); | |||
Onyx.merge(ONYXKEYS.USER, {expensifyNewsStatus: !!expensifyNewsStatus, validated: !!validatedStatus}); | |||
Onyx.set(ONYXKEYS.USER_LOGIN_LIST, loginList); |
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.
Wouldn't that make our loginList grow in size with lots of repeat logins?
These test steps could be more specific. Manual QA testers are not always going to recognize a flow by its filename. So let's tell them exactly how to visit these pages and what to test when they're on them. Seems like this is related to a performance issue? Should we add a test to see if things are faster? cc @Beamanator |
Done |
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 good. But we should clean the userPropTypes.js as well.
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.
Overall looking good, a few more points of feedback:
What about userPropTypes.js
? https://github.com/Expensify/App/blob/main/src/pages/settings/userPropTypes.js
- I believe we should remove the references to
loginList
in those prop types
Also I agree with @marcaaron that the testing steps should be improved - Manual QA testers are not always going to recognize a flow by its filename. So let's tell them exactly how to visit these pages and what to test when they're on them.
src/ONYXKEYS.js
Outdated
@@ -71,6 +71,9 @@ export default { | |||
// Contains all the users settings for the Settings page and sub pages | |||
USER: 'user', | |||
|
|||
// Contains user login list |
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.
Can we be more descriptive here? Something like:
// Contains user login list | |
// Contains metadata (partner, login, validation date) for all of the user's logins |
Updated |
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.
LGTM.
cc: @Beamanator
PR Reviewer Checklist
- I verified the PR has a small number of commits behind
main
- I verified the correct issue is linked in the
### Fixed Issues
section above - I verified testing steps are clear and they cover the changes made in this PR
- I verified the testing environment is mentioned in the test steps
- I verified testing steps cover success & fail scenarios (if applicable)
- I checked that screenshots or videos are included for tests on all platforms
- I verified tests pass on all platforms & I tested again on:
- iOS / native
- Android / native
- iOS / Safari
- Android / Chrome
- MacOS / Chrome
- MacOS / Desktop
- I verified there are no console errors related to changes in this PR
- I verified proper code patterns were followed (see Reviewing the code)
- I verified comments were added when the code was not self explanatory
- I verified any copy / text shown in the product was added in all
src/languages/*
files (if applicable) - I verified proper naming convention for platform-specific files was followed (if applicable)
- I verified style guidelines were followed
- I verified the JSDocs style guidelines (in
STYLE.md
) were followed
- I verified that this PR follows the guidelines as stated in the Review Guidelines
- I verified other components are not impacted by changes in this PR (i.e. if the PR modifies a shared library or component like
Avatar
, I verified the components usingAvatar
are working as expected) - I verified the UI performance was not affected (the performance is the same than
main
branch) - If a new component is created I verified that a similar component doesn't exist in the codebase
🎀 👀 🎀 C+ reviewed
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.
@parasharrajat can you bump us again for review when the QA steps are improved?
https://github.com/Expensify/App/blob/main/PR_REVIEW_GUIDELINES.md#example-of-good-steps
I thought this is NO QA but yes. @mdneyazahmad Please be more detailed in the QA steps.
How?
How?
How? you should specify the exact steps to verify all the above. |
Updated |
|
@parasharrajat Thank you |
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.
LGTM.
✋ 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 staging by @Beamanator in version: 1.1.47-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.49-1 🚀
|
Details
This pr refactors
loginList
from onyx keyuser
to a separate keyloginList
.Fixed Issues
$ #8051
Tests
This pr touches 5 files.
ProfilePage
andRequestCallPage
are the pages affected.Web (Optional)
All Platforms
Verify that no errors appear in the JS console
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)QA Steps
Web (Optional)
All Platforms
Verify that no errors appear in the JS console
Screenshots
Web
web.mp4
Mobile Web
mweb.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4