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-12-16] [$250] Web - IOU - Error message paying elsewhere partially a report with two held expenses and a tracked #53425

Open
1 of 8 tasks
IuliiaHerets opened this issue Dec 3, 2024 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 3, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.70-0
Reproducible in staging?: Y
Reproducible in production?: N
Issue was found when executing this PR: #49971
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/ on a workspace chat
  2. Submit 3 expenses (1 expense with a different currency) and track 1 forth expense
  3. Hold 2 expenses (1 expense with the different currency)
  4. Go back to the main chat
  5. Select Pay elsewhere on the report
  6. Confirm the partial amount

Expected Result:

The partial amount is paid

Actual Result:

"The requested amount has changed" error message is shown

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6682495_1733185782355.Recording__1103.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864070097967682615
  • Upwork Job ID: 1864070097967682615
  • Last Price Increase: 2024-12-03
Issue OwnerCurrent Issue Owner: @VictoriaExpensify
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

Triggered auto assignment to @VictoriaExpensify (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.

Copy link

melvin-bot bot commented Dec 3, 2024

Triggered auto assignment to @techievivek (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

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

@IuliiaHerets
Copy link
Author

Production behavior

Screen.Recording.2024-12-03.at.8.19.04.AM.mov

@techievivek
Copy link
Contributor

@bernhardoj Do you mind taking a look at this ticket and see if it's related to your changes above?

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

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

@melvin-bot melvin-bot bot changed the title Web - IOU - Error message paying elsewhere partially a report with two held expenses and a tracked [$250] Web - IOU - Error message paying elsewhere partially a report with two held expenses and a tracked Dec 3, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

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

@puneetlath puneetlath removed the DeployBlockerCash This issue or pull request should block deployment label Dec 3, 2024
@puneetlath
Copy link
Contributor

Demoting as discussed in thread: https://expensify.slack.com/archives/C01GTK53T8Q/p1733206499066379

@trjExpensify
Copy link
Contributor

P.S when trying to look at this from that thread, I was getting a duplicate report preview when I held an expense on v9.0.70-1 desktop app.

Steps:

  1. Create 2 expenses in the workspace currency
  2. Create 1 expense in a different currency
  3. Click into the expense report
  4. Hover over the preview of the first expense in the report.
  5. Click Hold from the comment action menu on the expense preview
  6. Observe the duplicate report preview created
image

@techievivek techievivek added Daily KSv2 and removed Hourly KSv2 labels Dec 4, 2024
@bernhardoj
Copy link
Contributor

I wanna test this on prod, but the PR is deployed to prod already. I think this issue exists on prod too. The prod video here doesn't show the pay behavior. The issue here is that, when we pay money request with held expenses partially, we use the amount of unheldTotal as the pay total.

App/src/libs/actions/IOU.ts

Lines 6642 to 6645 in 1462048

let total = (iouReport?.total ?? 0) - (iouReport?.nonReimbursableTotal ?? 0);
if (ReportUtils.hasHeldExpenses(iouReport?.reportID ?? '') && !full && !!iouReport?.unheldTotal) {
total = iouReport?.unheldTotal;
}

However, unheldTotal includes non-reimbursable transactions too (track), so we got the error. Previously unheldTotal doesn't include non-reimbursable transactions, but we agreed to update it on the BE to include it. Since it's a BE change and has been updated since 16 Oct, I believe this exists on prod too.

The solution to this is to subtract unheldTotal by unheldNonReimbursableTotal.

@s77rt
Copy link
Contributor

s77rt commented Dec 4, 2024

@bernhardoj This seems like something we missed? The plan already covered that.

In the approve modal display:

Partial: unheldTotal
Full: total

In the pay modal display:

Partial: unheldTotal - unheldNonReimbursableTotal
Full: total - nonReimbursableTotal

@s77rt
Copy link
Contributor

s77rt commented Dec 4, 2024

@bernhardoj Please raise a PR since this is a regression (or at least it's something that was supposed to be done in the PR)

@bernhardoj
Copy link
Contributor

This seems like something we missed? #49971 (comment) already covered that.

That plan only handles the amount to be shown, not the API params.

@bernhardoj
Copy link
Contributor

I'll handle this tomorrow.

@bernhardoj
Copy link
Contributor

PR is ready

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 9, 2024
@melvin-bot melvin-bot bot changed the title [$250] Web - IOU - Error message paying elsewhere partially a report with two held expenses and a tracked [HOLD for payment 2024-12-16] [$250] Web - IOU - Error message paying elsewhere partially a report with two held expenses and a tracked Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.72-1 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-12-16. 🎊

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

Copy link

melvin-bot bot commented Dec 9, 2024

@sobitneupane @VictoriaExpensify @sobitneupane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@sobitneupane
Copy link
Contributor

This issue was a regression from #49971 PR and is handled by the author of the PR, payment and checklist will be handled in the original issue.

@s77rt
Copy link
Contributor

s77rt commented Dec 15, 2024

Let's close this one. No payment is due here (regression)

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. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants