App: [PAID] [$500] Update getIOUReportActionDisplayMessage() to accept the transaction as a parameter
This is coming from https://github.com/Expensify/App/issues/27262. You can read the issue description there to get context behind the problem being solved and the mess being cleaned up.
Problem
ReportUtils.getIOUReportActionDisplayMessage() is called from a view component. It contains logic which calls const transaction = TransactionUtils.getTransaction(originalMessage.IOUTransactionID ?? ''); (a deprecated method).
Why this is important to fix
It maintains more pure and exact flow of data through the react application. If the view is using transaction data, then it needs to subscribe to the transaction in Onyx so that it’s assured that the transaction object will never be stale or out-of-date.
Solution
- Pass
transactionas a parameter togetIOUReportActionDisplayMessage()and get the parameter fromwithOnyx()in the view component. - Remove the deprecated method completely
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01cae110240999840b
- Upwork Job ID: 1768370164615811072
- Last Price Increase: 2024-03-14
- Automatic offers:
- hoangzinh | Reviewer | 0
- FitseTLT | Contributor | 0
Issue Owner
Current Issue Owner: @strepanier03About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 37 (27 by maintainers)
Yeah, I’ve got that follow-up issue assigned to me: https://github.com/Expensify/App/issues/39408
I’ll take a look at the logs today and see what I find.
On Wed, Apr 17, 2024 at 4:31 AM Vinh Hoang @.***> wrote:
I discussed this with @hoangzinh and we agreed to go with the proposal from @FitseTLT.
It was the most complete and it was posted earlier than the proposal from nkdengineer.
Hi @strepanier03 we don’t have a checklist for this issue because it’s not a bug fix but a technical improvement.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-04-15. 🎊
For reference, here are some details about the assignees on this issue:
@davidcardoza - Because it seemed like the best fit based on this doc.
I originally thought VSB but it says anything related to IOU and bills are “elsewhere”.
Then under VIP-bills it says “Anything related to bills and invoicing as part of an IOU request”.
PR will be up in 3days
I’m inclined to @nkdengineer’s proposal here https://github.com/Expensify/App/issues/38355#issuecomment-1998983450:
🎀👀🎀 C+ reviewed
@tgolen, I think we can simply use the
transactionsfromOnyxwhich we already have inReportUtilsto get the transaction. We are already using it in two places like that inReportUtilshttps://github.com/Expensify/App/blob/2faffcdc32bba21f24decabb25b313bf3653007d/src/libs/ReportUtils.ts#L2267 https://github.com/Expensify/App/blob/2faffcdc32bba21f24decabb25b313bf3653007d/src/libs/ReportUtils.ts#L5072I have updated my proposal