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

[$500] Task – Assignee with the custom name is shown as email in a task name #36443

Closed
3 of 6 tasks
izarutskaya opened this issue Feb 13, 2024 · 26 comments
Closed
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@izarutskaya
Copy link

izarutskaya commented Feb 13, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v1.4.41-2
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation:

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Login
  3. Navigate to a Group Chat
  4. Click on the + in the compose box and select "Assign task"
  5. Enter a a Title
  6. Assign a user with the custom name
  7. Create the task

Expected Result:

The assignee with the custom name is displayed in the assignee field with custom name

Actual Result:

Assignee with the custom name is shown as email in a task name

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6378618_1707856950328.Assignee_with_the_custom_name_is_shown_as_email_in_a_task_name.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a831cc646a8c8645
  • Upwork Job ID: 1757532483996348416
  • Last Price Increase: 2024-02-20
  • Automatic offers:
    • jjcoffee | Reviewer | 0
    • paultsimura | Contributor | 0
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 13, 2024
Copy link

melvin-bot bot commented Feb 13, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01a831cc646a8c8645

@melvin-bot melvin-bot bot changed the title Task – Assignee with the custom name is shown as email in a task name [$500] Task – Assignee with the custom name is shown as email in a task name Feb 13, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 13, 2024
Copy link

melvin-bot bot commented Feb 13, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

Copy link

melvin-bot bot commented Feb 13, 2024

Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@izarutskaya
Copy link
Author

We think that this bug might be related to #vip-vsb
CC @quinthar

@eucool
Copy link
Contributor

eucool commented Feb 13, 2024

Proposal

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

Assignee with the custom name is shown as email in a task name

What is the root cause of that problem?

We display the email instead of the user name:

taskAssigneeAccountID !== 0 ? `<comment><mention-user accountid="${taskAssigneeAccountID}"></mention-user> ${taskTitle}</comment>` : `<comment>${taskTitle}</comment>`;

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

Get personal details:

    const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;
    const assigneeLogin = personalDetails[taskAssigneeAccountID]?.login ?? '';
    const assigneeDisplayName = personalDetails[taskAssigneeAccountID]?.displayName ?? '';
    const taskAssignee = assigneeDisplayName || LocalePhoneNumber.formatPhoneNumber(assigneeLogin);

change the email to name assignment:

<mention-user accountid="${taskAssigneeAccountID}">@${taskAssignee}</mention-user>

What alternative solutions did you explore? (Optional)

N/A

@jeremy-croff
Copy link
Contributor

Regression?
8c802ed

@jjcoffee
Copy link
Contributor

Thanks @jeremy-croff, that does look like a possible regression. Checking with the PR author.

@jjcoffee
Copy link
Contributor

Looks like it's actually a regression from #35462 as the order was changed here. @mollfpr Can you check?

@mollfpr
Copy link
Contributor

mollfpr commented Feb 15, 2024

@jjcoffee Yeah, I think you are right. It should be prioritizing the displayName. Sorry, I didn't notice it, because the old file was deleted instead of renaming it 🙏

@jjcoffee
Copy link
Contributor

No worries, those are hard to catch! @ruben-rebelo As you worked on the PR, are you able to raise a quick fix for this regression?

@melvin-bot melvin-bot bot added the Overdue label Feb 19, 2024
@paultsimura
Copy link
Contributor

Hey @ruben-rebelo @mollfpr just another bump on this – we need the order to be fixed for another task as well 🙂

@jjcoffee
Copy link
Contributor

@adelekennedy This is a regression from #35462 but this is blocking other issues being fixed, so do you reckon it's worth just progressing with this as a normal issue, rather than waiting on @ruben-rebelo to raise a fix?

@melvin-bot melvin-bot bot removed the Overdue label Feb 19, 2024
@paultsimura
Copy link
Contributor

paultsimura commented Feb 19, 2024

Proposal

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

The login in mentions takes priority over the display name.

What is the root cause of that problem?

This is a regression from #35462, where the order of preference was changed:

displayNameOrLogin = LocalePhoneNumber.formatPhoneNumber(user?.login ?? '') || user?.displayName || translate('common.hidden');

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

We need to change the order of the display name calculation back to how it was pre-migration:

displayNameOrLogin = user?.displayName || LocalePhoneNumber.formatPhoneNumber(user?.login ?? '') || translate('common.hidden');

What alternative solutions did you explore? (Optional)

To make it more handy, we can reuse the PersonalDetailsUtils:

displayNameOrLogin = PersonalDetailsUtils.getDisplayNameOrDefault(user, LocalePhoneNumber.formatPhoneNumber(user?.login ?? ''));

function getDisplayNameOrDefault(passedPersonalDetails?: Partial<PersonalDetails> | null, defaultValue = '', shouldFallbackToHidden = true): string {
const displayName = passedPersonalDetails?.displayName ? passedPersonalDetails.displayName.replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, '') : '';
const fallbackValue = shouldFallbackToHidden ? Localize.translateLocal('common.hidden') : '';
return displayName || defaultValue || fallbackValue;
}

Copy link

melvin-bot bot commented Feb 20, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@jjcoffee
Copy link
Contributor

Happy to go with @paultsimura's proposal here in order to get this unblocked, as it doesn't seem that (regression PR author) @ruben-rebelo is working on a fix.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 20, 2024

Triggered auto assignment to @techievivek, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 21, 2024
Copy link

melvin-bot bot commented Feb 21, 2024

📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Feb 21, 2024

📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 21, 2024
@paultsimura
Copy link
Contributor

Thanks. The PR is ready for review: #36998

@adelekennedy
Copy link

SORRY - late payment from me

Payouts due:

Contributor: $500 @paultsimura (Upwork)
Contributor+: $500 @jjcoffee (Upwork)

Upwork job is here.

@adelekennedy
Copy link

adelekennedy commented Mar 11, 2024

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

  • The PR that introduced the bug has been identified. Link to the PR:
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • A regression test has been added or updated so that the same bug will not reach production again. Link to the GH issue for creating the test here:

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: [TS migration] Migrate HTMLRenderers components #35462
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/35462/files#r1521218238
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • Determine if we should create a regression test for this bug. Yes - if one doesn't exist already
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Create a task with any title
  2. Assign a user with a display name set
  3. Share somewhere
  4. Navigate to the chat where the task was shared
  5. Verify the assignment in the task preview shows the user's custom name

Do we agree 👍 or 👎

@adelekennedy
Copy link

makes sense to me - I'll wait if @techievivek has any more input

Copy link

melvin-bot bot commented Apr 5, 2024

This issue has not been updated in over 15 days. @paultsimura, @jjcoffee, @techievivek, @adelekennedy 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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Apr 5, 2024
@jjcoffee
Copy link
Contributor

jjcoffee commented Apr 8, 2024

@adelekennedy I think this can be closed?

@techievivek
Copy link
Contributor

Sorry I missed the ping, I have created a GH to add the regression test here: https://github.com/Expensify/Expensify/issues/385997, I am guessing payment is done here so we can close it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

8 participants