Repository navigation
[Awaiting C+ payment confo] Fix issues with the LHN previews and report actions surrounding iou/expenseReports when owed and paid. #30042
Description
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: v1.3.87-7
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @trjExpensify
Slack conversation: came from this issue.
Action Performed:
Create an iouReport
- Global Create > Request Money > $50 > choose a person > Confirm
- Land in the DM
- Look at the LHN row to observe the preview
Create an expenseReport
- Create a workspace if you need to
- Global Create > Request Money > $50 > choose the workspace > confirm
- Land in the workspace chat
- Look at the LHN row to observe the preview
Pay an iouReport
- Navigate to the iouReport view
- Click
Pay elsewheregreen button at the top right of the report
Pay an expenseReport
- Navigate to the expenseReport view
- Click
Pay elsewheregreen button at the top right of the report - Observe the system message added to the expenseReport
- Observe the LHN preview
Expected Result:
When an iouReport or expenseReport is "owed" the logic is as follows:
The logic for the LHN row when someone is owed is as follows:
Title: [%displayName% || %workspaceName%] owes £21.96
Preview: %firstName%: requested %amount% for [%merchant% || %comment%]
I.e
IOU Report
Jeff Banks owes £21.96
Tom: requested £5.00 for Thursday Lunch
Expense Report
Duraflame owes £21.96
Tom: requested £5.00 for Home Depot
When an iouReport or expenseReport is "paid" the logic is as follows:
- The reportAction added to the iouReport/expenseReport comes from the reimburser who paid
- The iouReport/expenseReport LHN title updates to "%workspaceName% paid %reportTotal%"
- The iouReport/expenseReport LHN preview shows the sys message in (1) from the reimburser.
- The DM/workspace chat LHN preview shows (2).
I.e
Report Action in the expense/iouReport
%reimburser% 11:58am
paid $50.00 elsewhere
expenseReport LHN
Duraflame paid $50.00
Tom: paid $50.00 elsewhere
workspace chat LHN
Joe Bloggs || Duraflame
Duraflame paid $50.00
Actual Result:
The LHN preview is incorrect when someone owes:
The report action added to the iou/expenseReport is incorrect when someone pays the report:
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01653befc45305851e
- Upwork Job ID: 1715173054584414208
- Last Price Increase: 2023-10-20
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Oct 20, 2023
Current assignee @mountiny is eligible for the Engineering assigner, not assigning anyone new.
melvin-bot commentedon Oct 20, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01653befc45305851e
melvin-bot commentedon Oct 20, 2023
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 20, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 20, 2023
Current assignee @mananjadhav is eligible for the Internal assigner, not assigning anyone new.
koko57 commentedon Oct 20, 2023
Ready to work on this issue 😊
117 remaining items
mountiny commentedon Jan 11, 2024
I do think we can keep this at $500 given the time this took to review and the complexity of the PR. We have reverted and did another attempt so its not like we have paid someone else for a fix.
@koko57 Lets create new issues for these. I believe you can create issues yourself, would you mind doing so and tagging me in them to apply the correct label.
Just link to this PR and frame the issue as Problem/ Solution
trjExpensify commentedon Jan 11, 2024
Perfect, sounds good to me. So confirming the payment is $500 to @mananjadhav for the C+ review. Feel free to go ahead and request money!
mountiny commentedon Jan 11, 2024
@mananjadhav once requested note here and we can close, thanks!
[-][HOLD for payment 2024-01-05] Fix issues with the LHN previews and report actions surrounding iou/expenseReports when owed and paid.[/-][+][Awaiting C+ payment confo] Fix issues with the LHN previews and report actions surrounding iou/expenseReports when owed and paid.[/+]mananjadhav commentedon Jan 12, 2024
I've requested the payment on NewDot.
trjExpensify commentedon Jan 12, 2024
Closing!
JmillsExpensify commentedon Jan 14, 2024
$500 payment approved for @mananjadhav based on this comment.
paultsimura commentedon Jan 20, 2024
Hey, just wanted to raise a little awareness: this PR likely caused a regression when an updated amount is not displayed in the LHN because of these lines:
App/src/libs/ReportUtils.ts
Lines 2254 to 2263 in 52adf77
Basically, that's because the
originalMessageholds only the initial amount value, notmodifiedAmount.I haven't seen a GH for this, just noticed it while working on one of my PRs.
cc: @mountiny @koko57
mountiny commentedon Jan 21, 2024
Pi believe this was raised internally but its true that the root cause is that the report action only has the original amount. So it might misbehave for smartscans specifically or when amount is edited
koko57 commentedon Jan 22, 2024
@paultsimura thanks for pointing this out! @mountiny yes, the last action for this type of chat doesn't have the updated value - we only have CREATED and IOU actions for this type of report and later we don't have the MODIFIEDEXPENSE action. If we go to the details we have the MODIFIEDEXPENSE action, so the preview is displaying a proper amount.




mountiny commentedon Jan 22, 2024
@koko57 Correct, but I believe we need to connect with Transaction collection in this case to make it work correctly.
the report action has the IOUTransactionID and that transaction object holds the correct amount