Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2024-02-05] [$500] IOU - "Total will update when you're back online" is missing on IOU request with foreign currency #33073

Closed kbecciv closed 9 months ago

kbecciv commented 11 months ago

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.4.12-2 Reproducible in staging?: y Reproducible in production?: n 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: Applause - Internal Team Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com.
  2. Go offline
  3. Click FAB > Request money > Manual.
  4. Request money from a user that has no existing chat.
  5. In 1:1 DM, click + > Request money.
  6. Create another manual request in a different currency.
  7. Click on the IOU preview.

Expected Result:

The message "Total will update when you're back online" will appear on the IOU request with foreign currency.

Actual Result:

The message "Total will update when you're back online" is missing on the IOU request with foreign currency.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/93399543/ab252618-5efd-49b0-8aee-2a09b1011db4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01337b668e29c97044
  • Upwork Job ID: 1735323595129638912
  • Last Price Increase: 2023-12-28
  • Automatic offers:
    • cubuspl42 | Reviewer | 28081826
    • dukenv0307 | Contributor | 28081827
Issue OwnerCurrent Issue Owner: @muttmuure
github-actions[bot] commented 11 months ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
melvin-bot[bot] commented 11 months ago

Triggered auto assignment to @arosiclair (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

Julesssss commented 11 months ago

This might not be reproducible on prod, as we're just about to release a new version.

kbecciv commented 11 months ago

Not reproduce on prod

image

Julesssss commented 11 months ago

@kbecciv I think web was deployed about 5 mins ago, so it might be a blocker from the previous release.

As this also isn't blocking any user flows, I'm going to remove the deploy blocker label.

melvin-bot[bot] commented 11 months ago

Triggered auto assignment to @muttmuure (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 11 months ago

Bug0 Triage Checklist (Main S/O)

arosiclair commented 11 months ago

I reproduced in prod v1.4.12-2

Screenshot 2023-12-14 at 10 37 43 AM
melvin-bot[bot] commented 11 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01337b668e29c97044

melvin-bot[bot] commented 11 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ArekChr (External)

bernhardoj commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

There is no pending conversion message when we request money with different currency while offline.

What is the root cause of that problem?

This is a regression from https://github.com/Expensify/App/pull/32653. One of the condition to show the pending conversion message is hasOutstandingIOU which is deprecated on that PR and replaced with chatReport.iouReportID.

image

But the chatReport itself is the report of the current chat, which is the iou, so iouReportID doesn't exist.

What changes do you think we should make in order to solve the problem?

If we want to check whether the iouReportID exist or not, we can check the requestReportID or maybe simply check the chatReport.reportID.

What alternative solutions did you explore? (Optional)

I did mention in the root cause that currently, chatReport is the iou report itself which is kinda weird. If we look at the comment of the props, it said that chatReport is the report that is associated with the iou report (basically the iou report parent). https://github.com/Expensify/App/blob/78ad3f9047025a37382a231a1968211c8ad4685a/src/components/ReportActionItem/MoneyRequestAction.js#L46-L48

So, I think the real fix here is to get the correct chatReport. To do that, we need to pass chatReportID here instead of reportID. https://github.com/Expensify/App/blob/78ad3f9047025a37382a231a1968211c8ad4685a/src/pages/home/report/ReportActionItem.js#L330-L331

But, we should only do that if the type is not split.

const chatReportID = originalMessage.type !== CONST.IOU.REPORT_ACTION_TYPE.SPLIT ? props.report.chatReportID : props.report.reportID;

Why?

props.report is the report that we currently view and MoneyRequestAction can be rendered in an IOU report or a chat report.

For request (create)/send money cases, a ReportPreview (the request preview) is shown in the chat report, and MoneyRequestAction (the individual request) is shown on the IOU report.

But for split requests, a MoneyRequestAction is shown in the chat report.

Then, I think checking the chatReport.iouReportID is not equivalent to hasOutstandingIOU, so we can update it to

chatReport.iouReportID === requestReportID
VadymDev27 commented 11 months ago

Can I work for Expensify?

melvin-bot[bot] commented 11 months ago

📣 @VadymDev27! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
dukenv0307 commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

The message "Total will update when you're back online" is missing on the IOU request with foreign currency.

What is the root cause of that problem?

  1. We pass the wrong chatReportID for IOU report here

https://github.com/Expensify/App/blob/4592a7c53a2e8bbbcb440dce8d07ccf165ce1cd3/src/pages/home/report/ReportActionItem.js#L331

And then chatReport.iouReportID is undefined https://github.com/Expensify/App/blob/4592a7c53a2e8bbbcb440dce8d07ccf165ce1cd3/src/components/ReportActionItem/MoneyRequestAction.js#L125

  1. mostRecentIOUReportActionID isn't changed when we create a new money request. So shouldShowPendingConversionMessage is only updated after we reload the page

https://github.com/Expensify/App/blob/4592a7c53a2e8bbbcb440dce8d07ccf165ce1cd3/src/pages/home/report/ReportActionsView.js#L90

What changes do you think we should make in order to solve the problem?

  1. Pass the correct chatReportID here
chatReportID={originalMessage.IOUReportID ? props.report.chatReportID : props.report.reportID}

https://github.com/Expensify/App/blob/4592a7c53a2e8bbbcb440dce8d07ccf165ce1cd3/src/pages/home/report/ReportActionItem.js#L331

  1. Use useMemo here to update mostRecentIOUReportActionID when props.reportActions.length is changed
const mostRecentIOUReportActionID = useMemo(() => ReportActionsUtils.getMostRecentIOURequestActionID(props.reportActions), [props.reportActions.length]);

https://github.com/Expensify/App/blob/4592a7c53a2e8bbbcb440dce8d07ccf165ce1cd3/src/pages/home/report/ReportActionsView.js#L90

Or we can remove this check here to display the message for all requests with foreign currency that are created in offline mode https://github.com/Expensify/App/blob/4592a7c53a2e8bbbcb440dce8d07ccf165ce1cd3/src/components/ReportActionItem/MoneyRequestAction.js#L126

What alternative solutions did you explore? (Optional)

NA

Result

https://github.com/Expensify/App/assets/129500732/8657eb4b-1d8b-4b94-ad90-da68ecffd49d

melvin-bot[bot] commented 11 months ago

@arosiclair, @ArekChr, @muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

ArekChr commented 11 months ago

Hey @arosiclair, I've left the c+team and joined Waves. Could you assign a new C+ here to handle this issue?

melvin-bot[bot] commented 11 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

arosiclair commented 11 months ago

@situchan can you review?

situchan commented 11 months ago

reviewing proposals

melvin-bot[bot] commented 11 months ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

arosiclair commented 10 months ago

Still waiting for reviews/proposals ^

melvin-bot[bot] commented 10 months ago

@arosiclair @muttmuure @situchan 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!

melvin-bot[bot] commented 10 months ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 10 months ago

@arosiclair, @muttmuure, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

arosiclair commented 10 months ago

bump @situchan

situchan commented 10 months ago

on it

melvin-bot[bot] commented 10 months ago

@arosiclair, @muttmuure, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

arosiclair commented 10 months ago

2 weeks without review. Assigning a new C+

melvin-bot[bot] commented 10 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External)

arosiclair commented 10 months ago

@cubuspl42 can you review the proposals we have?

situchan commented 10 months ago

Sorry for late. Just back from holidays. I will update today

situchan commented 10 months ago

@bernhardoj's alternative solution looks good. @dukenv0307 I see you added additional change to @bernhardoj's alternative solution. Can you explain in detail why that change is needed?

situchan commented 10 months ago

I can confirm that "Total will update when you're back online" message isn't moved to last one upon 3rd money request (before re-render). Though it's not directly related to this GH, I am inclined to @dukenv0307's proposal as this will be easily missed even in PR review.

@arosiclair all yours

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 10 months ago

Current assignee @arosiclair is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

arosiclair commented 10 months ago

@situchan I unassigned you already. It's okay to go on break but you have to say you're doing so. It very much seems like you left two dishonest updates about reviewing proposals over the last couple of weeks which delayed fixing this issue. Please be mindful of rule #2 and don't do this.

@cubuspl42 you're still the assigned C+ please review, thanks!

cubuspl42 commented 10 months ago

you're still the assigned C+ please review, thanks!

Ok, I'll catch up

cubuspl42 commented 10 months ago

@bernhardoj

In your proposal, you didn't state that the non-reactive mostRecentIOUReportActionID is a part of the problem. Does it mean that your solution doesn't need to touch that bit, or maybe this was overlooked?

@dukenv0307

We pass the wrong chatReportID for IOU report here

  1. Pass the correct chatReportID here

You used terms like "wrong" and "correct" in your proposal, kind of like it was obvious why those IDs were wrong/correct. Well, I don't think it is. Would you add a brief explanation? Do you understand the discussed report / chat report / IOU request structure, or did you just check what seems to work?

I won't lie that the entity relationship graph in Expensify is sometimes not 100% clear to me, although I've been involved with the project for quite some time.

dukenv0307 commented 10 months ago

@cubuspl42

  1. When we create a money request, the chat report is the report which contains the REPORTPREVIEW action.
  2. The IOU report is the child report of the chat report which contains the MoneyRequestPreview.
  3. The child report of IOU report is transsaction thread report.
  4. For split bills, we don't have the IOU report and the preview of split bill is MoneyRequestPreview. It's in the chat report.
bernhardoj commented 10 months ago

Does it mean that your solution doesn't need to touch that bit, or maybe this was overlooked?

I didn't realize that's an issue because I only do the OP test step 😅

cubuspl42 commented 10 months ago

I approve the proposal by @dukenv0307

Or we can remove this check here to display the message for all requests with foreign currency that are created in offline mode

I would investigate this during the PR phase, as it simplifies the solution and seems to be reasonable UX-wise

C+ reviewed 🎀 👀 🎀

melvin-bot[bot] commented 10 months ago

Current assignee @arosiclair is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 10 months ago

@cubuspl42 @arosiclair @muttmuure this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

melvin-bot[bot] commented 10 months ago

📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 10 months ago

📣 @dukenv0307 🎉 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 📖

dukenv0307 commented 10 months ago

@cubuspl42 The PR is ready for review.

melvin-bot[bot] commented 9 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 9 months ago

This issue has not been updated in over 15 days. @cubuspl42, @arosiclair, @muttmuure, @dukenv0307 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!

melvin-bot[bot] commented 9 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 9 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.32-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-02-05. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 9 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed: