App icon indicating copy to clipboard operation
App copied to clipboard

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

Open IuliiaHerets opened this issue 1 year ago β€’ 16 comments

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
  • [x] Android: mWeb Chrome
  • [ ] iOS: Standalone
  • [ ] iOS: HybridApp
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/78fa1055-323d-467b-bab7-8ec05654f562

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 avatar Nov 19 '24 12:11 IuliiaHerets

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[bot] avatar Nov 19 '24 12:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 25 '24 09:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 27 '24 09:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 29 '24 09:11 melvin-bot[bot]

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.

https://github.com/Expensify/App/blob/f12b73c3aff5fea8cb8d41f111d52d5bfd187eb1/src/libs/OptionsListUtils.ts#L491-L494

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.

https://github.com/Expensify/App/blob/f12b73c3aff5fea8cb8d41f111d52d5bfd187eb1/src/libs/OptionsListUtils.ts#L522

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 .

https://github.com/Expensify/App/blob/f12b73c3aff5fea8cb8d41f111d52d5bfd187eb1/src/libs/OptionsListUtils.ts#L522-L523

   ...

} 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);
}

Tony-MK avatar Nov 29 '24 20:11 Tony-MK

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

melvin-bot[bot] avatar Dec 02 '24 06:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 02 '24 06:12 melvin-bot[bot]

I can still reproduce this on chrome

adelekennedy avatar Dec 02 '24 06:12 adelekennedy

@Tony-MK's proposal works here.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed.

akinwale avatar Dec 03 '24 08:12 akinwale

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

melvin-bot[bot] avatar Dec 03 '24 08:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 03 '24 09:12 melvin-bot[bot]

@aldo-expensify bump on the proposal approval!

adelekennedy avatar Dec 05 '24 05:12 adelekennedy

@akinwale, @adelekennedy, @aldo-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 06 '24 09:12 melvin-bot[bot]

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 09 '24 16:12 melvin-bot[bot]

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

aldo-expensify avatar Dec 09 '24 21:12 aldo-expensify

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

aldo-expensify avatar Dec 10 '24 00:12 aldo-expensify

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

melvin-bot[bot] avatar Dec 13 '24 09:12 melvin-bot[bot]

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

aldo-expensify avatar Dec 13 '24 21:12 aldo-expensify

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 avatar Dec 13 '24 21:12 aldo-expensify

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

aldo-expensify avatar Dec 13 '24 21:12 aldo-expensify

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

https://github.com/user-attachments/assets/eb524dec-2212-44fc-8edd-ef621a42b6ba

aldo-expensify avatar Dec 13 '24 22:12 aldo-expensify

PR up: https://github.com/Expensify/Auth/pull/13548

aldo-expensify avatar Dec 13 '24 22:12 aldo-expensify

@akinwale, @adelekennedy, @aldo-expensify Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Dec 23 '24 09:12 melvin-bot[bot]

@akinwale, @adelekennedy, @aldo-expensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Dec 25 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 27 '24 09:12 melvin-bot[bot]

@akinwale, @adelekennedy, @aldo-expensify 12 days overdue. Walking. Toward. The. Light...

melvin-bot[bot] avatar Dec 31 '24 09:12 melvin-bot[bot]

This issue has not been updated in over 14 days. @akinwale, @adelekennedy, @aldo-expensify eroding to Weekly issue.

melvin-bot[bot] avatar Jan 03 '25 09:01 melvin-bot[bot]

This issue has not been updated in over 15 days. @akinwale, @adelekennedy, @aldo-expensify 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[bot] avatar Jan 27 '25 09:01 melvin-bot[bot]

@adelekennedy @aldo-expensify I believe this issue can be closed.

akinwale avatar Jan 30 '25 13:01 akinwale