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

[$250] IOU - Email is shown as a subtitle on LHN instead of added IOU amount #52761

Open
2 of 8 tasks
IuliiaHerets opened this issue Nov 19, 2024 · 22 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 19, 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: 9.0.64-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: https://expensify.testrail.io/index.php?/tests/view/5239196
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Send an IOU to account A from account B
  3. Observe LHN as account A
  4. Send another IOU to account A from account B again
  5. Observe LHN subtitle as account A

Expected Result:

LHN subtitle should show the added amount of the IOU's.

Actual Result:

LHN subtitle shows email instead of the added amounts of the IOU's

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6669140_1731999176449.bandicam_2024-11-19_09-47-55-337.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863465747822418752
  • Upwork Job ID: 1863465747822418752
  • Last Price Increase: 2024-12-09
Issue OwnerCurrent Issue Owner: @aldo-expensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

Triggered auto assignment to @adelekennedy (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.

@melvin-bot melvin-bot bot added the Overdue label Nov 22, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

Copy link

melvin-bot bot commented Nov 27, 2024

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

Copy link

melvin-bot bot commented Nov 29, 2024

@adelekennedy 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

@Tony-MK
Copy link
Contributor

Tony-MK commented Nov 29, 2024

Proposal

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

Email is shown as a subtitle on LHN instead of an added IOU amount.

What is the root cause of that problem?

The REPORT_PREVIEW action is not available in lastVisibleReportActions so the lastReportAction becomes null.

const lastReportAction = lastVisibleReportActions[reportID] ?? null;
// some types of actions are filtered out for lastReportAction, in some cases we need to check the actual last action
const lastOriginalReportAction = lastReportActions[reportID] ?? null;

Since the report has not been opened yet, the lastOriginalReportAction is the default first CREATED report action.

Screenshot 2024-11-29 at 21 57 54

Hence, the getLastMessageTextForReport function should not skip the check seen below but it does because lastReportAction is null.

} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {

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

Since report?.iouReportID and report?.lastActionType are present, we can create this condition, report?.iouReportID && report?.lastActionType === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW to get the lastMessageTextFromReport just after the ReportActionUtils.isReportPreviewAction check.

When the condition is true, we will do the same operations from the ReportActionUtils.isReportPreviewAction check to set the lastMessageTextFromReport to the reportPreviewMessage .

} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {
const iouReport = ReportUtils.getReportOrDraftReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(lastReportAction));

   ...

} else if (report?.iouReportID && report?.lastActionType === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW) {
    const iouReport = ReportUtils.getReportOrDraftReport(report?.iouReportID);
    const lastIOUMoneyReportAction = allSortedReportActions[iouReport?.reportID ?? '-1']?.find(
        (reportAction, key): reportAction is ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.IOU> =>
        ....
    );
    const reportPreviewMessage = ReportUtils.getReportPreviewMessage(
       !isEmptyObject(iouReport) ? iouReport : null,
       ....
    )
    lastMessageTextFromReport = ReportUtils.formatReportLastMessageText(reportPreviewMessage);
}

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Dec 2, 2024
@melvin-bot melvin-bot bot changed the title IOU - Email is shown as a subtitle on LHN instead of added IOU amount [$250] IOU - Email is shown as a subtitle on LHN instead of added IOU amount Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

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

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

melvin-bot bot commented Dec 2, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@adelekennedy
Copy link

I can still reproduce this on chrome

@akinwale
Copy link
Contributor

akinwale commented Dec 3, 2024

@Tony-MK's proposal works here.

🎀👀🎀 C+ reviewed.

Copy link

melvin-bot bot commented Dec 3, 2024

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

Copy link

melvin-bot bot commented Dec 3, 2024

@akinwale @adelekennedy @aldo-expensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@adelekennedy
Copy link

@aldo-expensify bump on the proposal approval!

Copy link

melvin-bot bot commented Dec 6, 2024

@akinwale, @adelekennedy, @aldo-expensify 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 Dec 6, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

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

@aldo-expensify
Copy link
Contributor

Sorry, I was OOO on Friday, and I'm catching up today. I'll get to this asap!

@aldo-expensify
Copy link
Contributor

I couldn't get to this today, I'll check tomorrow.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 10, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

@akinwale, @adelekennedy, @aldo-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Dec 13, 2024

Started testing this today. The email that appears after submitting a second expense is not just the email, it is the email plus the first amount:

image

The amount was not visible for the tester because the email is too long.

I have been hesitant of accepting the current proposal because this doesn't look like a front end only problem. The onyx report data is incorrect:

image

Which signals that the backend is not pushing the right updates here.

A solely front end fix feels like a workaround that is not addressing the root cause here.

Once we open the report, the report onyx data is updates and now the lastMessageHtml and lastActionType are correct:

image

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2024
@aldo-expensify
Copy link
Contributor

I'll take this Internal because the backend should be pushing the right lastMessageHtml / lastActionType when the first and second expenses are submitted.

@aldo-expensify aldo-expensify added Infra Internal Requires API changes or must be handled by Expensify staff and removed Infra External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Dec 13, 2024
@aldo-expensify
Copy link
Contributor

Added Infra label by mistake because the UI buttons jumped around 😬

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Dec 13, 2024

I believe this bug was caused by this PR here that is clearing the REPORTPREVIEW reportAction from the front end:

https://github.com/Expensify/Auth/pull/13112/files#diff-f11ec21da73b6b3e6067daf5047300859958522167fcfacca7ee4756502f0094R2914-R2920

Screen.Recording.2024-12-13.at.6.57.30.PM.mov

@aldo-expensify aldo-expensify added the Reviewing Has a PR in review label Dec 13, 2024
@aldo-expensify
Copy link
Contributor

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 Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review
Projects
Status: No status
Development

No branches or pull requests

5 participants