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

Expense - Copied content from paid expense preview in main chat is different from LHN preview #37655

Closed
6 tasks done
lanitochka17 opened this issue Mar 2, 2024 · 9 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Mar 2, 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: 1.4.46-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Log in to staging.new.expensify.com as employee
  2. Navigate to workspace chat with paid request
  3. Right click on the expense preview > Copy to clipboard
  4. Paste the content

Expected Result:

The copied content from the paid expense preview should have the same message as the preview in LHN

Actual Result:

The copied content from the paid expense preview is paid amount elsewhere, while the LHN preview shows paid amount

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

Add any screenshot/video evidence

Bug6399185_1709355806209.bandicam_2024-03-02_03-39-17-106.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 2, 2024
Copy link

melvin-bot bot commented Mar 2, 2024

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

@lanitochka17
Copy link
Author

@anmurali 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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave5
CC @dylanexpensify

@bernhardoj
Copy link
Contributor

bernhardoj commented Mar 3, 2024

Proposal

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

The text content copied from a paid report preview and the LHN's last message text is not consistent.

What is the root cause of that problem?

For report preview, we get the message using ReportUtils.getReportPreviewMessage.

App/src/libs/ReportUtils.ts

Lines 2394 to 2396 in 22cb01c

let actualPayerName = report.managerID === currentUserAccountID ? '' : getDisplayNameForParticipant(report.managerID, true);
actualPayerName = actualPayerName && isForListPreview && !isPreviewMessageForParentChatReport ? `${actualPayerName}:` : actualPayerName;
const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName;

If the report managerID is the same as the current user ID, which is true for your own policy expense chat, the display name will be empty, if it's different, then it will use the manager display name, except isPreviewMessageForParentChatReport is true where it will uses payerName which is a policy name if it's an expense report.

For copying the text, we didn't pass any value to isPreviewMessageForParentChatReport, so it will use the default value that is false.

For the LHN's last message text, we pass ReportUtils.isChatReport to isPreviewMessageForParentChatReport, so the display name (policy name) is shown.

lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(
!isEmptyObject(iouReport) ? iouReport : null,
lastIOUMoneyReportAction,
true,
ReportUtils.isChatReport(report),
null,
true,
);

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

We can make the condition consistent between the copying logic and the LHN's last message logic. (use the same param)

@melvin-bot melvin-bot bot added the Overdue label Mar 4, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

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

@anmurali
Copy link

anmurali commented Mar 5, 2024

Screen.Recording.2024-03-05.at.3.17.01.PM.mov

I cannot reproduce this. Also, why would anyone copy and paste this message?

@melvin-bot melvin-bot bot removed the Overdue label Mar 5, 2024
@bernhardoj
Copy link
Contributor

@anmurali you should copy the report preview from the policy expense chat. Notice that it uses the policy manager display name instead of the workspace name

Screen.Recording.2024-03-06.at.20.08.06.mov

Also, why would anyone copy and paste this message?

We allow the user to copy it, so I think it makes sense if we fix it.

@melvin-bot melvin-bot bot added the Overdue label Mar 8, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

@anmurali Huh... This is 4 days overdue. Who can take care of this?

@anmurali
Copy link

Notice that it uses the policy manager display name instead of the workspace name

I am still not sure this is actually a bug. We are copy and pasting the person that paid it... I don't think this is worth spending time on.

@melvin-bot melvin-bot bot removed the Overdue label Mar 13, 2024
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. Daily KSv2
Projects
None yet
Development

No branches or pull requests

3 participants