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 transaction as a parameter to getIOUReportActionDisplayMessage() and get the parameter from withOnyx() 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 OwnerCurrent Issue Owner: @strepanier03

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 37 (27 by maintainers)

Most upvoted comments

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:

oh @tgolen https://github.com/tgolen @FitseTLT https://github.com/FitseTLT we still have another follow-up task here #38882 (comment) https://github.com/Expensify/App/pull/38882#issuecomment-2020633332

— Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/38355#issuecomment-2060943910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMAB7LY6SXWEYW35LJJ43Y5ZFQ7AVCNFSM6AAAAABEWY4LNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRQHE2DGOJRGA . You are receiving this because you were mentioned.Message ID: @.***>

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:

  • It satisfies the requirements in the description.
  • It’s correct to me.
  • It’s detailed

🎀👀🎀 C+ reviewed

@tgolen, I think we can simply use the transactions from Onyx which we already have in ReportUtils to get the transaction. We are already using it in two places like that in ReportUtils https://github.com/Expensify/App/blob/2faffcdc32bba21f24decabb25b313bf3653007d/src/libs/ReportUtils.ts#L2267 https://github.com/Expensify/App/blob/2faffcdc32bba21f24decabb25b313bf3653007d/src/libs/ReportUtils.ts#L5072

I have updated my proposal