Skip to content

[$250] LHN - Email is displayed instead of user name on LHN message preview #59812

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

Open
2 of 8 tasks
nlemma opened this issue Apr 8, 2025 · 81 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@nlemma
Copy link

nlemma commented Apr 8, 2025

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: v9.1.24-2
Reproducible in staging?: Yes
Reproducible in production?: N/A
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #59252
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: MacOS Chrome, Desktop
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Start a chat with a user who has a display name (user A)
  2. Click + > Create expense > Add amount > Next > Click Create expense
  3. Navigate away form the chat
  4. Go to Settings > Preferences > change priority mode to focus
  5. Return to LHN
  6. Go to Settings > Preferences > change priority mode to Most recent
  7. Return to LHN
  8. Open the chat with user A

Expected Result:

'User's display name owes amount' message should be displayed on LHN of the user you have requested money from

Actual Result:

'User's email owes amount' message is displayed on LHN. And the message is changed to 'User's display name owes amount' when opening the chat

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6795782_1744098119397.Screen_Recording_2025-04-08_at_10.29.59_in_the_morning.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021909701114419801250
  • Upwork Job ID: 1909701114419801250
  • Last Price Increase: 2025-04-22
  • Automatic offers:
    • thelullabyy | Contributor | 107032873
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @thelullabyy
@nlemma nlemma added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlockerCash This issue or pull request should block deployment labels Apr 8, 2025
Copy link

melvin-bot bot commented Apr 8, 2025

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented Apr 8, 2025

Triggered auto assignment to @rlinoz (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Apr 8, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 8, 2025
Copy link
Contributor

github-actions bot commented Apr 8, 2025

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@nlemma
Copy link
Author

nlemma commented Apr 8, 2025

@lschurr FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@samranahm
Copy link
Contributor

Dupe of #59566

@rlinoz
Copy link
Contributor

rlinoz commented Apr 8, 2025

@nlemma why reproducible in production is N/A in this case?

If it is really a dupe as @samranahm is saying I think this should be reproducible in prod.

@nlemma
Copy link
Author

nlemma commented Apr 8, 2025

Testers are seeing different behavior in production compared to staging for this issue.

Image

bandicam.2025-04-08.16-11-15-769.mp4

@samranahm
Copy link
Contributor

@rlinoz we have a bit different behabour for 1:1 chats in staging now #58271 (comment) we also discuss about it here #59566 (comment)

@jasperhuangg
Copy link
Contributor

@samranahm Can you explain how this is a duplicate and how a proposal for that issue would fix this one?

@samranahm
Copy link
Contributor

@jasperhuangg Sorry my bad that was similar one but for another translation iou.payerPaidAmount but here the issue is about iou.payerOwesAmount

@samranahm
Copy link
Contributor

samranahm commented Apr 8, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-04-12 11:58:53 UTC.

Proposal

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

LHN - Email is displayed instead of user name on LHN message preview

What is the root cause of that problem?

return translateLocal('iou.payerOwesAmount', {payer: payerName ?? '', amount: formattedAmount, comment});

We pass the payer here without checking if its DM (we are not displaying the payerName for 1:1)
when there is no payerName

formattedLogin cause the email to display in alternate text

if (shouldShowLastActorDisplayName(report, lastActorDetails)) {
result.alternateText = `${lastActorDisplayName}: ${formatReportLastMessageText(Parser.htmlToText(lastMessageText)) || formattedLogin}`;

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

Here

return translateLocal('iou.payerOwesAmount', {payer: payerName ?? '', amount: formattedAmount, comment});

We should explicitly check if the report is DM and in such case pass an empty string for payer to 'iou.payerOwesAmount'

return translateLocal('iou.payerOwesAmount', {payer: isDM(parentReport) ? '' : (payerName ?? ''), amount: formattedAmount, comment});

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

To prevent the potential regression we can utilize isForListPreview

return isDM(report) && isForListPreview
    ? translateLocal('iou.payerOwesAmount', {payer: '', amount: formattedAmount, comment})
    : translateLocal('iou.payerOwesAmount', {payer: payerName ?? '', amount: formattedAmount, comment});

@samranahm
Copy link
Contributor

LHN-812.mp4

@rlinoz
Copy link
Contributor

rlinoz commented Apr 8, 2025

Right, I think we can demote this one and get it fixed.

I think the problem is just not showing up in prod because we are not showing the IOU as the last message for some reason in prod.

@rlinoz rlinoz added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 Daily KSv2 labels Apr 8, 2025
@Ollyws
Copy link
Contributor

Ollyws commented Apr 24, 2025

@rlinoz no it's to return the display names instead of the emails in reportActionMessage

Copy link

melvin-bot bot commented Apr 28, 2025

@rlinoz, @Ollyws, @lschurr, @thelullabyy Whoops! This issue is 2 days overdue. Let's get this updated quick!

@thelullabyy
Copy link
Contributor

@rlinoz Any new update from BE side?

@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2025
@rlinoz
Copy link
Contributor

rlinoz commented Apr 30, 2025

This looks like a simple change, I will check internally if there is any reason this should not be changed and will post back.

Copy link

melvin-bot bot commented May 2, 2025

@thelullabyy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label May 2, 2025
@rlinoz
Copy link
Contributor

rlinoz commented May 2, 2025

Writing PRs for this, should put for review on Monday.

PRs are up actually, probably deployed early next week.

Copy link

melvin-bot bot commented May 6, 2025

@thelullabyy Still overdue 6 days?! Let's take care of this!

@rlinoz
Copy link
Contributor

rlinoz commented May 6, 2025

@thelullabyy this is in staging

@thelullabyy
Copy link
Contributor

thelullabyy commented May 7, 2025

@Ollyws After this PR. The behavior related to Bug 2 is changed. With that new change, we never show the "You". What should we do in this situation?
Root cause by this logic

lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW

@melvin-bot melvin-bot bot removed the Overdue label May 7, 2025
@lschurr lschurr moved this to Bugs and Follow Up Issues in #expensify-bugs May 8, 2025
@Ollyws
Copy link
Contributor

Ollyws commented May 9, 2025

Hmm good question, that PR does seem to violate the expected behaviour as detailed in this comment: #59812 (comment)
@rlinoz Do you have any idea as to the expected behaviour for the You: ?

@melvin-bot melvin-bot bot added the Overdue label May 9, 2025
@rlinoz
Copy link
Contributor

rlinoz commented May 9, 2025

From what I can tell that PR is just trying to avoid showing You: Manager:, and we still want to show You: when it makes sense.

Copy link

melvin-bot bot commented May 12, 2025

@thelullabyy Eep! 4 days overdue now. Issues have feelings too...

@Ollyws
Copy link
Contributor

Ollyws commented May 12, 2025

Hmm well #60307 has removed You: when the last message is an IOU or report preview.
Perhaps we can re-instate the You: for report previews aside from the Manager: case.

@rlinoz
Copy link
Contributor

rlinoz commented May 12, 2025

Yeah, actually cc @Expensify/design on this one.

When you create a report and we are showing the report preview message in the LHN, how should it be displayed?

  1. You: ${User B's display name} owes ${amount}
  2. ${User B's display name} owes ${amount}

@dannymcclain
Copy link
Contributor

I'm honestly getting a little lost in all these—personally, I think it would be best to create the least amount of exceptions as possible, and have them all work as similarly as possible. Definitely want to hear others' thoughts who maybe have more understanding of how all these work though.

@shawnborton
Copy link
Contributor

When you create a report and we are showing the report preview message in the LHN, how should it be displayed?

I think we need to first determine if we think a workspace chat should behave like a DM between two people (we never show You for previews), or more like a group or room (we always show You for previews). I think technically it's more like a room? So that being said, if you send a message in a room, we always prepend You: to the message preview. So I would expect the same here I think.

@rlinoz
Copy link
Contributor

rlinoz commented May 12, 2025

I agree workspace chats are more like rooms and it would be best to have the same pattern.

Perhaps we can re-instate the You: for report previews aside from the Manager: case.

So I guess we can go on with this @Ollyws @thelullabyy

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels May 13, 2025
@thelullabyy
Copy link
Contributor

Thanks, I opened PR here

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

10 participants