[Refactor] onyx key user#8264
[Refactor] onyx key user#8264Beamanator merged 6 commits intoExpensify:mainfrom mdneyazahmad:refactor/8051-onyx-key-user
Conversation
src/libs/actions/User.js
Outdated
| 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.
Prefer merge. Not needed.
There was a problem hiding this comment.
Wouldn't that make our loginList grow in size with lots of repeat logins?
There was a problem hiding this comment.
Yeah, Correct. LodashMerge.....
parasharrajat
left a comment
There was a problem hiding this comment.
Let's get the screenshots of running app after login screen for each platform.
src/libs/actions/User.js
Outdated
| 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.
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 |
parasharrajat
left a comment
There was a problem hiding this comment.
Looks good. But we should clean the userPropTypes.js as well.
Beamanator
left a comment
There was a problem hiding this comment.
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
loginListin 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
| // 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.
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.
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 Issuessection 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 usingAvatarare working as expected) - I verified the UI performance was not affected (the performance is the same than
mainbranch) - If a new component is created I verified that a similar component doesn't exist in the codebase
🎀 👀 🎀 C+ reviewed
marcaaron
left a comment
There was a problem hiding this comment.
@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 |
|
✋ 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
loginListfrom onyx keyuserto a separate keyloginList.Fixed Issues
$ #8051
Tests
This pr touches 5 files.
ProfilePageandRequestCallPageare the pages affected.Web (Optional)
All Platforms
Verify that no errors appear in the JS console
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis 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