Skip to content
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

[HOLD for payment 2023-11-13] [HOLD for payment 2023-10-30] [$500] Update LHN/chat header to handle displayName not being set #27393

Closed
puneetlath opened this issue Sep 13, 2023 · 44 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Weekly KSv2

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Sep 13, 2023

We are going to stop sending a display name from the back-end in certain scenarios. In those scenarios, we should fall back on using "Hidden" in the LHN and Chat Header (and anywhere else that relies on display name being set).

Let's update any place that expects a display name to fall back on the primary login. And if there is neither a displayName or a primary login, to fall back on "Hidden".

Screenshot 2023-09-13 at 7 13 20 PM

Issue reported by: @parasharrajat
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694550580877519

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011dd93c0b122cf21f
  • Upwork Job ID: 1715060740724056064
  • Last Price Increase: 2023-10-19
@puneetlath puneetlath added Daily KSv2 NewFeature Something to build that is a new item. labels Sep 13, 2023
@puneetlath puneetlath self-assigned this Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Sep 13, 2023
@hungvu193
Copy link
Contributor

hungvu193 commented Sep 14, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Update LHN/chat header to handle displayName not being set

What is the root cause of that problem?

We're still returning empty string incase we don't have the value for shortName and longName.

App/src/libs/ReportUtils.js

Lines 1099 to 1107 in d68263a

function getDisplayNameForParticipant(accountID, shouldUseShortForm = false) {
if (!accountID) {
return '';
}
const personalDetails = getPersonalDetailsForAccountID(accountID);
const longName = personalDetails.displayName;
const shortName = personalDetails.firstName || longName;
return shouldUseShortForm ? shortName : longName;
}

What changes do you think we should make in order to solve the problem?

We can add more condition if both of these values are empty, we should use primaryLogin or "Hidden":

    if (_.isEmpty(longName) && _.isEmpty(shortName)) {
        return personalDetails.login || Localize.translate("common.hidden");
    }
    return shouldUseShortForm ? shortName : longName;

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 14, 2023
@lukemorawski
Copy link
Contributor

@puneetlath It's Lucas from Callstack. Happy to work on that. Just wanted to clarify one thing. By fallback to "Hidden" you mean displaying a text "Hidden" in the header and LHN?

@puneetlath
Copy link
Contributor Author

Yes, exactly. Let's have the text "Hidden" be the final fallback text whenever we use display names and aren't able to find either a display name or a login.

@lukemorawski
Copy link
Contributor

@puneetlath How can I create an account with no display name, to test that change?

@puneetlath
Copy link
Contributor Author

We chatted in Slack, but this will only be testable by adding fake data in Onyx or removing data from an existing user.

@sakluger
Copy link
Contributor

This issue was reported by @parasharrajat before @puneetlath created this issue. I've added the Slack thread where the issue was reported so that @parasharrajat can be paid out the reporting bonus.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Oct 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 2023

This issue has not been updated in over 15 days. @puneetlath, @lukemorawski eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@puneetlath puneetlath added Daily KSv2 and removed Monthly KSv2 labels Oct 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

@puneetlath, @lukemorawski Whoops! This issue is 2 days overdue. Let's get this updated quick!

@parasharrajat
Copy link
Member

This is missing an external label.

@puneetlath
Copy link
Contributor Author

Does that also handle adding back the previous changes that were reverted?

@lukemorawski
Copy link
Contributor

Ah, dang it, they reverted themselves after I resolved a conflict against "main" branch! Such a noob thing to do 🤦‍♂️ Give me a moment while I'll bring 'em back.

@puneetlath
Copy link
Contributor Author

Haha all good! Git is fun 😅

@lukemorawski
Copy link
Contributor

@puneetlath updated the latest PR with all the changes!

@puneetlath
Copy link
Contributor Author

Great!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 29, 2023
Copy link

melvin-bot bot commented Nov 3, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-30] [$500] Update LHN/chat header to handle displayName not being set [HOLD for payment 2023-11-13] [HOLD for payment 2023-10-30] [$500] Update LHN/chat header to handle displayName not being set Nov 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Nov 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.95-9 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 2023-11-13. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 6, 2023

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

Copy link

melvin-bot bot commented Nov 7, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($500)

Copy link

melvin-bot bot commented Nov 7, 2023

📣 @allroundexperts Please request via NewDot manual requests for the Contributor role ($500)

@puneetlath
Copy link
Contributor Author

Note to self: both @mananjadhav and @allroundexperts were involved in PR review here. Will need to figure out compensation.

@0xmiros
Copy link
Contributor

0xmiros commented Nov 12, 2023

Just to clarify
First attempt: #27547 caused #30032, #30022
2nd attempt: #30342 caused #30846, #30847

@puneetlath
Copy link
Contributor Author

puneetlath commented Nov 13, 2023

Payment Summary:

Please both request on NewDot.

@JmillsExpensify
Copy link

$500 payment approved for @mananjadhav based on summary above.

@JmillsExpensify
Copy link

$500 payment approved for @allroundexperts based on summary above.

@parasharrajat
Copy link
Member

Looks like, we missed the reporting bonus for me here. @puneetlath Could you please add that to the payment summary? Thanks.

@puneetlath
Copy link
Contributor Author

Whoops, sorry about that. Updated @parasharrajat

@parasharrajat
Copy link
Member

Payment requested as per #27393 (comment)

@JmillsExpensify
Copy link

$50 payment approved for @parasharrajat based on this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants