Closed IuliiaHerets closed 1 week ago
Triggered auto assignment to @twisterdotcom (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.
We think that this bug might be related to #wave-collect - Release 1
@twisterdotcom 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
LHN last message shows 0 amount in one-expense report if the expense is a scan request.
The one-expense report "lastMessageText" itself is "$0.00 expense". Looks like the last message when we do a scan request is always like that. But if we open an empty transaction thread, the last message shown in LHN is "No activity yet". I believe we want the last message for one-expense report to be the same as transaction thread, so I'll explain why the last message shown in LHN is different.
When we get the last message of a report, we take its last visible action and we create it based on the action type. https://github.com/Expensify/App/blob/50de692ff915d7998bff3fb0d024446b59912b52/src/libs/OptionsListUtils.ts#L593-L595
If the last message is still empty, we fallback to the report lastMessageText
property.
https://github.com/Expensify/App/blob/50de692ff915d7998bff3fb0d024446b59912b52/src/libs/OptionsListUtils.ts#L671-L677
In one-expense report, the last report action is null because the last report action is the CREATED action, but we filter it out, so, it fallback to the lastMessageText
which is "$0.00 expense".
This is the same case as one-transaction thread too, but the lastMessageText
is empty, so, it gets the last message from the welcome message, which is also empty for a chat thread (including transaction thread), so we finally fallback to "No activity yet".
https://github.com/Expensify/App/blob/50de692ff915d7998bff3fb0d024446b59912b52/src/libs/SidebarUtils.ts#L448-L449
https://github.com/Expensify/App/blob/50de692ff915d7998bff3fb0d024446b59912b52/src/libs/SidebarUtils.ts#L488-L492
To show "No activity yet" for one-expense report too,
OptionsListUtils.getLastMessageTextForReport
.
if (!lastReportAction && transactionThreadReportIDs[reportID]) {
return "";
} else if (ReportUtils.isArchivedRoom(report, reportNameValuePairs)) {
transactionThreadReportIDs
is a new variable that stores the one-transaction thread report ID for each one-expense report.
const transactionThreadReportIDs = {};
transactionThreadReportIDs[reportID] = transactionThreadReportID;
getWelcomeMessage
to return empty welcome message for one-expense report too.
https://github.com/Expensify/App/blob/50de692ff915d7998bff3fb0d024446b59912b52/src/libs/SidebarUtils.ts#L488-L492 || !!ReportActionsUtils.getOneTransactionThreadReportID(report?.reportID ?? '-1', reportActions)
We will pass the reportActions as the param of getWelcomeMessage
.
Job added to Upwork: https://www.upwork.com/jobs/~01676bf97c74d0768c
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (External
)
LHN preview for the expense report shows 0.00. This issue only happens when there is only one scan expense in the report.
When the expense report is a combined report, we filtered out the IOU
action of expense report via getCombinedReportActions
function here
That makes lastReportAction
here null
then we fallback to report.lastMessageText
which is 0.00 expense
in this case
I think we should not filter out the IOU
action in OptionsListUtils
because we will use this action to get the correct last message text. For example, if the receipt is scanning, LHN should display Receipt scanning...
that is the behavior when the expense report is not a combined report.
To do that we can create a new param in getCombinedReportActions
like shouldFilterIOUAction
with default value is true
then if it's false
we will return early here
if (!isMoneyRequestAction(action) || !shouldFilterIOUAction) {
return true;
}
NA
@twisterdotcom, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Two proposals have different output
No activity yet
when the receipt is being scanned and after the scan is successful Receipt scanning...
if the receipt is being scanned and display the correct amount (getting from transaction) after the scanning is successfulNote that the amount from both report.lastMessagetext
and reportAction.message/originalMessage
is returned wrong from BE
The decision to assign this task to someone depends on our expectation. Let's wait for the final decision from the internal engineer
π π π C+ reviewed
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
It will display Receipt scanning... if the receipt is being scanned and display the correct amount (getting from transaction) after the scanning is successful
That seems correct to me. Receipt scanning...
(during scanning), $x.xx expense
(after scanning, if successful). The latter being consistent with "manual" one expense reports on prod:
Yeah I would tend to agree too.
One question about the approach though (and maybe this can be discussed in the PR) is why do we need a new param shouldFilterIOUAction
? Or asked differently, when would we use true
and when would we use false
? If we only set it to false
for one-transaction reports, could we count how many items are in filteredParentReportActions
instead?
Basically, I'm thinking if we can avoid introducing a new param, it's one less chance that someone will use it wrong in the future and cause a bug.
π£ @DylanDylann π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @nkdengineer π 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 π
This issue has not been updated in over 15 days. @francoisl, @twisterdotcom, @DylanDylann, @nkdengineer 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!
@twisterdotcom @francoisl Please help to process payment here
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: v9.0.23-0 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
LHN preview for the expense report will show the correct scanned amount.
Actual Result:
LHN preview for the expense report shows 0.00. This issue only happens when there is only one scan expense in the report.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/aa964514-eb12-434d-8933-8537968c8591
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @DylanDylann