-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Update all usage of User(ONYXKEYS.USER), to use Account(ONYXKEYS.ACCOUNT) #60851
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
base: main
Are you sure you want to change the base?
Update all usage of User(ONYXKEYS.USER), to use Account(ONYXKEYS.ACCOUNT) #60851
Conversation
Once this is reviewed and merged, the next step (D) will be App cleanup to remove all the User model in the App, including the hook introduced here. |
@ Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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'm not sure if this should be No QA - it touches a lot of flows related to the account/user, right?
Is there a way we can break this PR down into smaller ones so we can have QA test these flows?
@MariaHCD Fair point, it touches all the flows where user/account is invoked (All usage of User(ONYXKEYS.USER) has been replaced with Account(ONYXKEYS.ACCOUNT)). I initially added NO QA as it’s purely a cross-cutting refactor with no UI changes. But will nevertheless add a list of test cases so that potential issues / regressions can be surfaced. Regarding breaking the PR down into several smaller ones, I'm wary of doing this. Since every screen in this change uniformly uses ONYXKEYS.ACCOUNT, QA only needs to validate one consistent flow; splitting this into pieces would introduce mixed USER/ACCOUNT subscriptions and dramatically multiply the states they have to test. Keeping it as one atomic switch preserves a single end-to-end path, simplifies validation, and makes rollback trivial. |
Explanation of Change
We have two models in the App that essentially represent the same thing: User and Account and this leads to a risk of duplicated information. We are thus in the process of deprecating User.ts and merge it into Account.ts to standardise and prevent duplicate information from being added to both models.
This change is step C of the entire process. i.e: Update all usage of User(ONYXKEYS.USER) in the frontend (App), to use Account(ONYXKEYS.ACCOUNT)
Fixed Issues
Part of #59277
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop