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-07-22] [HOLD for payment 2024-07-17] [$250] Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN #43907

Closed
1 of 6 tasks
lanitochka17 opened this issue Jun 18, 2024 · 29 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 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 18, 2024

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: 1.4.85-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): berhanesarah.testing+@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to FAB
  2. Click on "Pay someone"
  3. Enter an amount
  4. Select a person to share with and click Pay Elsewhere
  5. Open the report preview and observe the LHN

Expected Result:

The correct amount paid is displayed

Actual Result:

Payment amount shows 0.00

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

Bug6517141_1718713682847.2024-06-18_15_11_02.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ccd1bdf56c93987f
  • Upwork Job ID: 1805623061027700874
  • Last Price Increase: 2024-06-25
  • Automatic offers:
    • c3024 | Reviewer | 102906573
    • dominictb | Contributor | 102906574
Issue OwnerCurrent Issue Owner: @OfstadC
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

Triggered auto assignment to @OfstadC (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@OfstadC
Copy link
Contributor

OfstadC commented Jun 19, 2024

Thanks! I'm having trouble setting up a wallet to test this as my flow (without a bank/card linked) is different. I'll follow up soon

@OfstadC OfstadC added the Needs Reproduction Reproducible steps needed label Jun 20, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Jun 20, 2024

I'm having an issue adding a wallet - hoping to resolve today so I can test this. 😃

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@mallenexpensify
Copy link
Contributor

Able to repro. Want me to take this from ya @OfstadC ?

2024-06-21_11-17-32.mp4

logs
logs-2024-06-21 18_18_43.259.txt

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Jun 24, 2024

Added to #vip-split

@melvin-bot melvin-bot bot removed the Overdue label Jun 24, 2024
@c3024

This comment was marked as off-topic.

@OfstadC OfstadC added the External Added to denote the issue can be worked on by a contributor label Jun 25, 2024
@melvin-bot melvin-bot bot changed the title Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN [$250] Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01ccd1bdf56c93987f

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

@dominictb
Copy link
Contributor

dominictb commented Jun 25, 2024

Proposal

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

Payment amount shows 0.00

What is the root cause of that problem?

We're getting the last message text in

App/src/libs/ReportUtils.ts

Lines 4043 to 4046 in 67f92c6

const amount =
type === CONST.IOU.REPORT_ACTION_TYPE.PAY
? CurrencyUtils.convertToDisplayString(getMoneyRequestSpendBreakdown(!isEmptyObject(report) ? report : undefined).totalDisplaySpend, currency)
: CurrencyUtils.convertToDisplayString(total, currency);

and report in this case is undefined since we haven't created it yet (on Onyx)

-> getMoneyRequestSpendBreakdown function is getting the report as undefined

-> 0 is returned

App/src/libs/ReportUtils.ts

Lines 2375 to 2378 in 67f92c6

return {
nonReimbursableSpend: 0,
reimbursableSpend: 0,
totalDisplaySpend: 0,

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

Solution 1:

We should add the condition to check if it's the uncreated report, then use CurrencyUtils.convertToDisplayString(total, currency); instead

const amount =
        type === CONST.IOU.REPORT_ACTION_TYPE.PAY && !isEmptyObject(report)
            ? CurrencyUtils.convertToDisplayString(getMoneyRequestSpendBreakdown(report).totalDisplaySpend, currency)
            : CurrencyUtils.convertToDisplayString(total, currency);

Solution 2:

It can be useless to get the reportID from report, then try to find the report by reportID. That way also cause the bug when report is not created on Onyx

I suggest to pass the iouReport instead of iouReportID for getIOUReportActionMessage function

then use the temp iouReport in

const iouAction = buildOptimisticIOUReportAction(

What alternative solutions did you explore? (Optional)

Result

@c3024
Copy link
Contributor

c3024 commented Jun 26, 2024

The issue arises because the report is accessed in the getIOUReportActionMessage while generating the optimisticIOUReportAction, before the optimisticIOUReport is actually stored in Onyx.

Implementing Solution 2 from @dominictb's proposal—which involves replacing iouReport with iouReportID—would require altering the parameters of buildOptimisticIOUReportAction and other related functions. Since buildOptimisticIOUReportAction is a widely used function, and using only iouReportID (without immediate access to the report in Onyx) appears to function correctly in other scenarios, it would be prudent to avoid this modification.

Therefore, integrating the !isEmptyObject(report) check into the conditional and utilizing total (a param in the getIOUReportActionMessage) to derive the message, as outlined in Solution 1 of @dominictb’s proposal, seems to be the preferable approach.

🎀 👀 🎀 C+ Reviewed

Copy link

melvin-bot bot commented Jun 26, 2024

Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@OfstadC OfstadC removed the Needs Reproduction Reproducible steps needed label Jun 27, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Jun 27, 2024

Friendly bump @stitesExpensify 😃

@stitesExpensify
Copy link
Contributor

I agree, solution 1 makes sense!

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

melvin-bot bot commented Jun 27, 2024

📣 @c3024 🎉 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 Jun 27, 2024

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

@OfstadC
Copy link
Contributor

OfstadC commented Jul 9, 2024

Looks like a PR has been merged!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot changed the title [$250] Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN [HOLD for payment 2024-07-17] [$250] Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN Jul 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

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

Copy link

melvin-bot bot commented Jul 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-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-07-17. 🎊

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

Copy link

melvin-bot bot commented Jul 10, 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:

  • [@c3024] The PR that introduced the bug has been identified. Link to the PR:
  • [@c3024] 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:
  • [@c3024] 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:
  • [@c3024] Determine if we should create a regression test for this bug.
  • [@c3024] 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.
  • [@OfstadC] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/412734

@OfstadC
Copy link
Contributor

OfstadC commented Jul 11, 2024

@c3024 Could you please complete the BZ Checklist? Thank you 😃

@c3024 c3024 mentioned this issue Jul 12, 2024
57 tasks
@c3024
Copy link
Contributor

c3024 commented Jul 12, 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:

  • [@c3024] The PR that introduced the bug has been identified. Link to the PR: Implement report approvals #24639
  • [@c3024] 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: https://github.com/Expensify/App/pull/24639/files#r1675756776
  • [@c3024] 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. This is too specific a bug to be identified earlier.
  • [@c3024] Determine if we should create a regression test for this bug. Yes
  • [@c3024] 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.

Regression test proposal

  1. Press on FAB > Pay someone
  2. Enter some amount 'X' > Next
  3. Select a user to share with and press Pay Elsewhere
  4. Press on the report preview of this paid request and observe the LHN
  5. Verify that LHN shows paid 'X' elsewhere instead of paid (or sent) 0.00 elsewhere

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-17] [$250] Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Pay Someone-Payment amount from "Pay someone" shows 0.00 on LHN Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 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-07-22. 🎊

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

Copy link

melvin-bot bot commented Jul 15, 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:

  • [@c3024] The PR that introduced the bug has been identified. Link to the PR:
  • [@c3024] 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:
  • [@c3024] 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:
  • [@c3024] Determine if we should create a regression test for this bug.
  • [@c3024] 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.
  • [@OfstadC] 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 and removed Weekly KSv2 labels Jul 16, 2024
@c3024
Copy link
Contributor

c3024 commented Jul 17, 2024

@OfstadC

Checklist here. There seems to be some issue with automation. Payment is due on 17-Jul.

@OfstadC
Copy link
Contributor

OfstadC commented Jul 17, 2024

Payment Summary:
@c3024 paid $250 via Upwork
@dominictb paid $250 via Upwork

@OfstadC
Copy link
Contributor

OfstadC commented Jul 17, 2024

Closing this out since Regression testing has been created and payment has been issued 😃

@OfstadC OfstadC closed this as completed Jul 17, 2024
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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants