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 2024-04-15] [$500] IOU - Multiline IOU description from 1:1 DM in LHN is not truncated #39437

Closed
6 tasks done
kbecciv opened this issue Apr 2, 2024 · 22 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Apr 2, 2024

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: 1.4.59-0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to 1:1 DM with user that has no unsettled IOU.
  3. Create a money request with multiline description.

Expected Result:

The 1:1 DM preview in LHN will show truncated IOU description.

Actual Result:

Multiline IOU description from 1:1 DM in LHN is not truncated.

Workaround:

n/a

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

Bug6435827_1712078095418.20240403_011039.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d08ecf7ecf737a6d
  • Upwork Job ID: 1775285976769712128
  • Last Price Increase: 2024-04-02
  • Automatic offers:
    • bernhardoj | Contributor | 0
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

Copy link
Contributor

github-actions bot commented Apr 2, 2024

👋 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.

@kbecciv
Copy link
Author

kbecciv commented Apr 2, 2024

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

@chiragsalian
Copy link
Contributor

chiragsalian commented Apr 2, 2024

Tossing it to external to help find the source of the issue sooner since I'm not looking at this for the next few hours. if there hasn't been any progress I'll work on it later.

@chiragsalian chiragsalian added the External Added to denote the issue can be worked on by a contributor label Apr 2, 2024
@melvin-bot melvin-bot bot changed the title IOU - Multiline IOU description from 1:1 DM in LHN is not truncated [$500] IOU - Multiline IOU description from 1:1 DM in LHN is not truncated Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 3, 2024

Proposal

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

The chat report LHN subtitle shows as multiline when having a money request with multi line description.

What is the root cause of that problem?

The LHN subtitle when there is a report preview is taken from this logic.

} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {
const iouReport = ReportUtils.getReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(lastReportAction));
const lastIOUMoneyReportAction = allSortedReportActions[iouReport?.reportID ?? '']?.find(
(reportAction, key) =>
ReportActionUtils.shouldReportActionBeVisible(reportAction, key) &&
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE &&
ReportActionUtils.isMoneyRequestAction(reportAction),
);
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(
!isEmptyObject(iouReport) ? iouReport : null,
lastIOUMoneyReportAction,
true,
ReportUtils.isChatReport(report),
null,
true,
lastReportAction,
);
} else if (ReportActionUtils.isReimbursementQueuedAction(lastReportAction)) {

getReportPreviewMessage has lots of logic inside it, but in our case, it returns {payer} owes {amount} for {description}. If the description is multi-line, the LHN will show it as multi-line too. This doesn't happen if we open the IOU report because in IOU report, the action is a money request action, and for money request action we already handle the multiline by using formatReportLastMessageText.

} else if (ReportActionUtils.isMoneyRequestAction(lastReportAction)) {
const properSchemaForMoneyRequestMessage = ReportUtils.getReportPreviewMessage(report, lastReportAction, true, false, null, true);
lastMessageTextFromReport = ReportUtils.formatReportLastMessageText(properSchemaForMoneyRequestMessage);
} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {

I think this issue has been there and not a regression. In production, the LHN subtitle won't show the description of the money request ({payer} owes {amount}) (which is a regression from this PR). Then, the regression is fixed by adding back the description and now the QA catch this multi-line issue.

EDIT: I can't find the PR, but it might start to happen when we add description to the report preview message.

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

Use formatReportLastMessageText for report preview action too.

} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {
const iouReport = ReportUtils.getReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(lastReportAction));
const lastIOUMoneyReportAction = allSortedReportActions[iouReport?.reportID ?? '']?.find(
(reportAction, key) =>
ReportActionUtils.shouldReportActionBeVisible(reportAction, key) &&
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE &&
ReportActionUtils.isMoneyRequestAction(reportAction),
);
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(
!isEmptyObject(iouReport) ? iouReport : null,
lastIOUMoneyReportAction,
true,
ReportUtils.isChatReport(report),
null,
true,
lastReportAction,
);

or maybe we can use it when returning the value here so all case is applied,

return lastMessageTextFromReport || (report?.lastMessageText ?? '');

@parasharrajat
Copy link
Member

parasharrajat commented Apr 3, 2024

Ah, it might be a regression from #34840 which I reviewed. 🥲 . Can't verify on that PR as we are forced to update the app.

But it has already been two weeks for that PR into the production.So I think we can go with @bernhardoj's proposal.

I like the idea of universal formatting but let's make sure we don't over do it. We want to reduce the execution time for this function not increase it.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Apr 3, 2024

Current assignee @chiragsalian is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@chiragsalian
Copy link
Contributor

Proposal LGTM, are you around to create a PR for this @bernhardoj in the next hour or so?

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

melvin-bot bot commented Apr 3, 2024

📣 @bernhardoj 🎉 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 📖

@bernhardoj
Copy link
Contributor

Yes, I'm available. Will open the PR in a few moments.

@parasharrajat
Copy link
Member

parasharrajat commented Apr 3, 2024

Thats, great. Thanks @bernhardoj

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Apr 3, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @parasharrajat

@jasperhuangg jasperhuangg added Hourly KSv2 and removed Weekly KSv2 labels Apr 3, 2024
@chiragsalian
Copy link
Contributor

Fixes have been CP-d to staging. Tested on staging and it LGTM so removing blocker label.
image

image

@chiragsalian
Copy link
Contributor

Thanks for the quick turnaround time 🙂

@chiragsalian chiragsalian added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 3, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 8, 2024
@melvin-bot melvin-bot bot changed the title [$500] IOU - Multiline IOU description from 1:1 DM in LHN is not truncated [HOLD for payment 2024-04-15] [$500] IOU - Multiline IOU description from 1:1 DM in LHN is not truncated Apr 8, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

Copy link

melvin-bot bot commented Apr 8, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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 2024-04-15. 🎊

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 14, 2024
Copy link

melvin-bot bot commented Apr 15, 2024

Issue is ready for payment but no BZ is assigned. @zanyrenney you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

@zanyrenney
Copy link
Contributor

payment summary

@parasharrajat requires payment through NewDot Manual Requests - please request $500
@bernhardoj requires payment automatic offer (Contributor) paid $500 via upwork.

Closing.

@parasharrajat
Copy link
Member

Payment requested as per #39437 (comment)

@JmillsExpensify
Copy link

$500 approved for @parasharrajat

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants