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

[$250] IOU - Multiple IOUs are unapproved when a single IOU is unapproved #44969

Closed
5 of 6 tasks
izarutskaya opened this issue Jul 8, 2024 · 31 comments
Closed
5 of 6 tasks
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

@izarutskaya
Copy link

izarutskaya commented Jul 8, 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: v9.0.5-3
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Precondition: Create workspace > More features > Enable workflow > Enable Add approvals > Make yourself approver

  1. Navigate to a workspace chat
  2. Submit 2 manual requests with different amounts
  3. Click on the IOU preview component
  4. Click Approve button
  5. Click on the IOUs
  6. Click header
  7. Click unapprove
  8. Navigate back to expense report

Expected Result:

Only the unapproved report should be unapproved

Actual Result:

Both IOUs are unapproved

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

Bug6535812_1720442435170.Screen_Recording_2024-07-08_at_3.29.15_in_the_afternoon.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0166593468459204f3
  • Upwork Job ID: 1810443215436393315
  • Last Price Increase: 2024-07-08
Issue OwnerCurrent Issue Owner: @lschurr
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

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

Copy link

melvin-bot bot commented Jul 8, 2024

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

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

github-actions bot commented Jul 8, 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.

@izarutskaya
Copy link
Author

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

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@izarutskaya
Copy link
Author

Production
image

@lschurr
Copy link
Contributor

lschurr commented Jul 8, 2024

Hi hi @stitesExpensify - Can you check on this and confirm if it's a deploy blocker? Do we need to add External here?

@stitesExpensify
Copy link
Contributor

Checking

@stitesExpensify stitesExpensify added 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 labels Jul 8, 2024
@melvin-bot melvin-bot bot changed the title IOU - Multiple IOUs are unapproved when a single IOU is unapproved [$250] IOU - Multiple IOUs are unapproved when a single IOU is unapproved Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

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

Copy link

melvin-bot bot commented Jul 8, 2024

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

@stitesExpensify
Copy link
Contributor

Commented here #44229

@bernhardoj
Copy link
Contributor

Proposal

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

All transactions are unapproved when a single transaction is unapproved.

What is the root cause of that problem?

The approve option is available on the expense report which will approve all the transactions, so it makes sense if unapprove will unapprove all transactions too. They both work on the expense report level, not on each transaction.

So, I think the real issue here is that the Unapprove option is shown on the transaction thread details page. That's because when we check whether the report is a money request report or not, we always pass the money request report itself, which is true for the transaction thread too.

const canUnapproveRequest =
ReportUtils.isMoneyRequestReport(moneyRequestReport) &&
(ReportUtils.isReportManager(moneyRequestReport) || isPolicyAdmin) &&
(ReportUtils.isReportApproved(moneyRequestReport) || ReportUtils.isReportManuallyReimbursed(moneyRequestReport));

The moneyRequestReport variable holds the parentx money request report of the transaction.

const moneyRequestReport: OnyxEntry<OnyxTypes.Report> = useMemo(() => {
if (caseID === CASES.MONEY_REQUEST) {
return parentReport;
}
return report;
}, [caseID, parentReport, report]);

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

We should check for the current report instead of the moneyRequestReport.

const canUnapproveRequest =
ReportUtils.isMoneyRequestReport(moneyRequestReport) &&
(ReportUtils.isReportManager(moneyRequestReport) || isPolicyAdmin) &&
(ReportUtils.isReportApproved(moneyRequestReport) || ReportUtils.isReportManuallyReimbursed(moneyRequestReport));

ReportUtils.isMoneyRequestReport(report) && ...

@suneox
Copy link
Contributor

suneox commented Jul 9, 2024

Thank @bernhardoj for the proposal. I’ll start reviewing it.

@suneox
Copy link
Contributor

suneox commented Jul 9, 2024

I’m still stuck when trying to approve an expense due to the requirement to add a payment card. I have tried a lot of test cards provided by stripe, bluesnap, plaid but none of them worked.
@stitesExpensify, do you have documentation on how to bypass the “add payment card” step in a dev environment?

@Beamanator Beamanator removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 9, 2024
@Beamanator
Copy link
Contributor

Fix merged & CPing

@Beamanator
Copy link
Contributor

Should be good now, IOUs are no longer Unapprovable 👍 tested in 9.0.5-6 👍

@Beamanator Beamanator added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jul 9, 2024
@Beamanator
Copy link
Contributor

Beamanator commented Jul 9, 2024

Keeping open so @bernhardoj can get paid for his solution here that I implemented in #45049 (along with another small change) 🙏 - cc @lschurr

Copy link

melvin-bot bot commented Jul 12, 2024

@Beamanator, @suneox, @lschurr, @stitesExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Jul 12, 2024
@Beamanator
Copy link
Contributor

@lschurr can you help us retest? This should have been fixed already

@lschurr
Copy link
Contributor

lschurr commented Jul 15, 2024

Yes, I'm a bit behind but can test tomorrow - @bernhardoj @suneox are you able to jump in and test this?

@melvin-bot melvin-bot bot removed the Overdue label Jul 15, 2024
@bernhardoj
Copy link
Contributor

Tested on staging, the Unapprove button doesn't show on the transaction thread anymore 🎉

web.mp4

@melvin-bot melvin-bot bot added the Overdue label Jul 18, 2024
@lschurr
Copy link
Contributor

lschurr commented Jul 18, 2024

Woop! Amazing. Is there a PR associated with this specific GH that requires payment or are we good to close?

@melvin-bot melvin-bot bot removed the Overdue label Jul 18, 2024
@Beamanator
Copy link
Contributor

PR was #45049! But it fixed multiple issues FYI 🙏

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
@lschurr
Copy link
Contributor

lschurr commented Jul 22, 2024

Ok, so payment is being issued elsewhere? Or do we need to pay here @Beamanator?

Copy link

melvin-bot bot commented Jul 22, 2024

@Beamanator @suneox @lschurr @stitesExpensify 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!

@garrettmknight
Copy link
Contributor

@lschurr I think it's just payment for @bernhardoj here via this comment.

@garrettmknight garrettmknight added the Awaiting Payment Auto-added when associated PR is deployed to production label Jul 23, 2024
@lschurr
Copy link
Contributor

lschurr commented Jul 23, 2024

Great, thanks!

Payment summary:

  • Contributor: @bernhardoj $250 (please request in NewDot)

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@melvin-bot melvin-bot bot added the Overdue label Jul 25, 2024
@lschurr lschurr closed this as completed Jul 25, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jul 25, 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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

9 participants