-
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
[Due for payment 2025-02-19] [HOLD for payment 2025-02-07] [$250] Profile - Display Name Not Live Updated When Adding Legal Name to New Account #52900
Comments
Triggered auto assignment to @zanyrenney ( |
Edited by proposal-police: This proposal was edited at 2024-11-21 13:34:28 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Profile - Display Name Not Live Updated When Adding Legal Name to New Account What is the root cause of that problem?When we call api App/src/libs/actions/PersonalDetails.ts Lines 126 to 135 in 5955bd7
What changes do you think we should make in order to solve the problem?We should update like BE is returning when we call {
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: {
[currentUserAccountID]: {
displayName: PersonalDetailsUtils.createDisplayName(currentUserEmail ?? '', {
legalFirstName,
legalLastName,
}),
},
},
}, We can update field What alternative solutions did you explore? (Optional) |
Edited by proposal-police: This proposal was edited at 2024-11-22 15:42:19 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Display Name Not Live Updated When Adding Legal Name to New Account What is the root cause of that problem?When we call updateLegalName to update the legal name, we do not call updateDisplayName, so the display name will not be updated.
And we can see the update when navigating back because openReport has updated the display name. What changes do you think we should make in order to solve the problem?To resolve this issue, we must call updateDisplayName when the legal name is changed. Some thing like this: //src/pages/settings/Profile/PersonalDetails/LegalNamePage.tsx#L23
const updateLegalName = (values: PrivatePersonalDetails) => {
+ PersonalDetails.updateDisplayName(values.legalFirstName?.trim() ?? '', values.legalLastName?.trim() ?? '');
PersonalDetails.updateLegalName(values.legalFirstName?.trim() ?? '', values.legalLastName?.trim() ?? '');
};
POCScreen.Recording.2024-11-22.at.22.26.47.movWhat alternative solutions did you explore? (Optional)Alternative 1Or, if we only want to update the display name during the first legal name update, it could be something like this: We must move //src/pages/settings/Profile/PersonalDetails/LegalNamePage.tsx#L32
const updateLegalName = (values: PrivatePersonalDetails) => {
+ if (!privatePersonalDetails?.legalFirstName || !privatePersonalDetails?.legalLastName) {
+ PersonalDetails.updateDisplayName(values.legalFirstName?.trim() ?? '', values.legalLastName?.trim() ?? '');
+ }
PersonalDetails.updateLegalName(values.legalFirstName?.trim() ?? '', values.legalLastName?.trim() ?? '');
}; Alternative 2Or, if we only want to update the display name when it is null or set to an email, it could look like this: //src/pages/settings/Profile/PersonalDetails/LegalNamePage.tsx#L32
+ const currentUserPersonalDetails = useCurrentUserPersonalDetails();
+ const [session] = useOnyx(ONYXKEYS.SESSION);
const updateLegalName = (values: PrivatePersonalDetails) => {
+ if (!currentUserPersonalDetails?.displayName || currentUserPersonalDetails?.displayName === session?.email) {
+ PersonalDetails.updateDisplayName(values.legalFirstName?.trim() ?? '', values.legalLastName?.trim() ?? '');
+ }
PersonalDetails.updateLegalName(values.legalFirstName?.trim() ?? '', values.legalLastName?.trim() ?? '');
};
Note: Or, when updating the display name, we will discuss and make updates accordingly. |
@zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Job added to Upwork: https://www.upwork.com/jobs/~021861461957491636641 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
@alitoshmatov we already have two proposals, please can you review? Thanks! |
ProposalPlease re-state the problem that we are trying to solve in this issue.The Display Name does not update live after adding a legal name. It only updates after navigating back. What is the root cause of that problem?Now, if the user doesn't set the display name, the default display name is the user's login. When we update the legal name and the display name is still the default, the backend only returns the updated data for This bug will not happen in the past because Now What changes do you think we should make in order to solve the problem?
App/src/libs/actions/PersonalDetails.ts Line 47 in c4ff235
What alternative solutions did you explore? (Optional) |
@zanyrenney, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too... |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@Themoonalsofall Thank you for your proposal, your RCA is correct and solution solve the issue |
@huult Thank you for your proposal, your RCA is also correct. your solution is very similar to previous proposal |
@nkdengineer Thank you for your proposal, your solution is still not working in offline and I don't think overloading callback function with another onyx update is a good idea. |
I think we can go with @Themoonalsofall 's proposal which applies optimistically updates first name, lastname, and display name when display name is default value C+ reviewed 🎀 👀 🎀 |
Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @Themoonalsofall You have been assigned to this job! |
Payment Summary
BugZero Checklist (@zanyrenney)
|
Let's hold for #56399 follow up PR which fixes a mistake that we overlook on original PR. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.97-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-02-19. 🎊 For reference, here are some details about the assignees on this issue:
|
@alitoshmatov @zanyrenney @alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalTest:
Do we agree 👍 or 👎 |
Payment Summary
BugZero Checklist (@zanyrenney)
|
Can I get a payment summary on this issue? |
Just getting the regression test done and then will add the payment summary, Jason! |
payment summary |
https://www.upwork.com/jobs/~021892984706846801193 - @Themoonalsofall here is the job. |
@Themoonalsofall offer sent! |
payment summary |
$250 approved for @alitoshmatov |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.0.65-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+tw33434343553@applause.expensifail.com
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
When a legal name is added to a newly created account (or an account without a previously set display name), the Display Name should automatically inherit the legal name and update in real time.
Actual Result:
The Display Name does not update live after adding a legal name. It only updates after navigating back.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6671636_1732178835063.Screen_Recording_2024-11-21_at_12.31.52_AM.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @zanyrenneyThe text was updated successfully, but these errors were encountered: