Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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
6 tasks done
kbecciv opened this issue Dec 14, 2023 · 55 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Dec 14, 2023

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6313200_1702566519378.20231214_193924.mp4

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
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Dec 14, 2023
Copy link
Contributor

👋 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.

Copy link

melvin-bot bot commented Dec 14, 2023

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

@Julesssss
Copy link
Contributor

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

@kbecciv
Copy link
Author

kbecciv commented Dec 14, 2023

Not reproduce on prod

image

@Julesssss
Copy link
Contributor

@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.

@Julesssss Julesssss added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment labels Dec 14, 2023
Copy link

melvin-bot bot commented Dec 14, 2023

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

Copy link

melvin-bot bot commented Dec 14, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@arosiclair
Copy link
Contributor

arosiclair commented Dec 14, 2023

I reproduced in prod v1.4.12-2

Screenshot 2023-12-14 at 10 37 43 AM

@arosiclair arosiclair added External Added to denote the issue can be worked on by a contributor and removed Engineering labels Dec 14, 2023
@melvin-bot melvin-bot bot changed the title IOU - "Total will update when you're back online" is missing on IOU request with foreign currency [$500] IOU - "Total will update when you're back online" is missing on IOU request with foreign currency Dec 14, 2023
Copy link

melvin-bot bot commented Dec 14, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 14, 2023
Copy link

melvin-bot bot commented Dec 14, 2023

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 14, 2023

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 #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).

/* Onyx Props */
/** chatReport associated with iouReport */
chatReport: reportPropTypes,

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.

<MoneyRequestAction
chatReportID={props.report.reportID}

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
Copy link

Can I work for Expensify?

Copy link

melvin-bot bot commented Dec 14, 2023

📣 @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
Copy link
Contributor

dukenv0307 commented Dec 15, 2023

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

chatReportID={props.report.reportID}

And then chatReport.iouReportID is undefined

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

const mostRecentIOUReportActionID = useInitialValue(() => ReportActionsUtils.getMostRecentIOURequestActionID(props.reportActions));

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}

chatReportID={props.report.reportID}

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

const mostRecentIOUReportActionID = useInitialValue(() => ReportActionsUtils.getMostRecentIOURequestActionID(props.reportActions));

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

isMostRecentIOUReportAction &&

What alternative solutions did you explore? (Optional)

NA

Result

Screen.Recording.2023-12-15.at.11.41.22.mov

Copy link

melvin-bot bot commented Dec 18, 2023

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 4, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

📣 @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

Copy link

melvin-bot bot commented Jan 4, 2024

📣 @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
Copy link
Contributor

@cubuspl42 The PR is ready for review.

Copy link

melvin-bot bot commented Jan 26, 2024

⚠️ 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 melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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 melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Jan 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] IOU - "Total will update when you're back online" is missing on IOU request with foreign currency [HOLD for payment 2024-02-05] [$500] IOU - "Total will update when you're back online" is missing on IOU request with foreign currency Jan 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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

Copy link

melvin-bot bot commented Jan 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.32-5 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-02-05. 🎊

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

Copy link

melvin-bot bot commented Jan 29, 2024

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:

  • [@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
  • [@cubuspl42] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@cubuspl42] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@cubuspl42] Determine if we should create a regression test for this bug.
  • [@cubuspl42] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@muttmuure] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Feb 5, 2024
@arosiclair
Copy link
Contributor

bump @cubuspl42 ^

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2024
@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
    • It seems that the bug was present in the relevant components since they were created
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • N/A
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • Up to the QA team
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • Go offline
    • Request money in your default currency from a user which doesn't have any unsettled money requests
    • Again, request money from the same user, but in another currency
    • Click/tap on the IOU preview
    • Verify that "Total will update when you're back online" text appears on the request in the non-default currency

@cubuspl42
Copy link
Contributor

@arosiclair Sorry! Done

@arosiclair
Copy link
Contributor

No need for additional regression steps since QA is the one to catch this. All yours @muttmuure

@muttmuure
Copy link
Contributor

All paid up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants