[$250] IOU - Email is shown as a subtitle on LHN instead of added IOU amount
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:
- Navigate to staging.new.expensify.com
- Send an IOU to account A from account B
- Observe LHN as account A
- Send another IOU to account A from account B again
- 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
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 Owner
Current Issue Owner: @aldo-expensify
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.
@adelekennedy Eep! 4 days overdue now. Issues have feelings too...
@adelekennedy Still overdue 6 days?! Let's take care of this!
@adelekennedy 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
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.
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);
}
Job added to Upwork: https://www.upwork.com/jobs/~021863465747822418752
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (External)
I can still reproduce this on chrome
Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@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!
@aldo-expensify bump on the proposal approval!
@akinwale, @adelekennedy, @aldo-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
Sorry, I was OOO on Friday, and I'm catching up today. I'll get to this asap!
I couldn't get to this today, I'll check tomorrow.
@akinwale, @adelekennedy, @aldo-expensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
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:
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:
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:
I'll take this Internal because the backend should be pushing the right lastMessageHtml / lastActionType when the first and second expenses are submitted.
Added Infra label by mistake because the UI buttons jumped around π¬
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
PR up: https://github.com/Expensify/Auth/pull/13548
@akinwale, @adelekennedy, @aldo-expensify Eep! 4 days overdue now. Issues have feelings too...
@akinwale, @adelekennedy, @aldo-expensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@akinwale, @adelekennedy, @aldo-expensify 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
@akinwale, @adelekennedy, @aldo-expensify 12 days overdue. Walking. Toward. The. Light...
This issue has not been updated in over 14 days. @akinwale, @adelekennedy, @aldo-expensify eroding to Weekly issue.
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!
@adelekennedy @aldo-expensify I believe this issue can be closed.