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-05-20] Split scan - Split preview does not show individual split amount under "Split amounts" list #41758

Closed
6 tasks done
m-natarajan opened this issue May 7, 2024 · 18 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented May 7, 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: 1.4.71-0
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 to group chat.
  3. Go to + > Split expense.
  4. Go to Scan.
  5. Upload a receipt.
  6. Split the expense.
  7. Click on the split preview.
  8. Enter amount.
  9. Split the expense.
  10. Click on the split preview.

Expected Result:

The split preview will show individual split amount under "Split amounts" list.

Actual Result:

The split preview does not show individual split amount under "Split amounts" list.

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

Bug6473655_1715080219392.split_scan_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019be40158dc575160
  • Upwork Job ID: 1787967813100097536
  • Last Price Increase: 2024-05-07
Issue OwnerCurrent Issue Owner: @miljakljajic
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

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

Copy link

melvin-bot bot commented May 7, 2024

Triggered auto assignment to @miljakljajic (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 May 7, 2024
Copy link
Contributor

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

@miljakljajic
Copy link
Contributor

@flodnv what do you think - is this actually a DB? I know you're working on the fire right now

@m-natarajan
Copy link
Author

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

@m-natarajan
Copy link
Author

We think this bug might be related to #vip-split

@nexarvo
Copy link
Contributor

nexarvo commented May 7, 2024

Proposal

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

Split preview does not show individual split amount under "Split amounts" list

What is the root cause of that problem?

We are not getting amount in transaction.comment.splits:
Screenshot 2024-05-07 at 7 11 03 PM
And we only checking if we don't have splits then calculate amount here:

isPolicyExpenseChat || !transaction?.comment?.splits

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

We can update the condition to check if we have amount in the split or not and if we don't have amount then calculate the amount like this:

if (iouAmount > 0) {
+    const splitAmount = transaction.comment.splits.find((split) => split.accountID === participantOption.accountID)?.amount ?? null;

    amount =
-        isPolicyExpenseChat || !transaction?.comment?.splits
+        isPolicyExpenseChat || !transaction?.comment?.splits || !splitAmount
            ? IOUUtils.calculateAmount(selectedParticipants.length, iouAmount, iouCurrencyCode ?? '', isPayer)
-            transaction.comment.splits.find((split) => split.accountID === participantOption.accountID)?.amount
+            : splitAmount;

}

Note

In the suggested code I have created splitAmount variable to be re-used. We can also refactor this in PR step.

What alternative solutions did you explore? (Optional)

Result

Screen.Recording.2024-05-07.at.7.18.48.PM.mov

@kbecciv kbecciv added the DeployBlocker Indicates it should block deploying the API label May 7, 2024
@marcaaron marcaaron assigned marcaaron and unassigned flodnv May 7, 2024
@marcaaron
Copy link
Contributor

marcaaron commented May 7, 2024

cc @youssef-lr This feels like a pretty mainline flow. Should we patch this before deploying?

@youssef-lr
Copy link
Contributor

I'll include a fix in my current follow up PR @marcaaron

@youssef-lr youssef-lr added the Internal Requires API changes or must be handled by Expensify staff label May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

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

Copy link

melvin-bot bot commented May 7, 2024

Current assignee @allroundexperts is eligible for the Internal assigner, not assigning anyone new.

@yuwenmemon yuwenmemon removed the DeployBlocker Indicates it should block deploying the API label May 7, 2024
@marcaaron marcaaron removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels May 7, 2024
@marcaaron marcaaron added the Daily KSv2 label May 7, 2024
@kavimuru
Copy link

kavimuru commented May 8, 2024

@youssef-lr
Copy link
Contributor

This is fixed.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 13, 2024
@melvin-bot melvin-bot bot changed the title Split scan - Split preview does not show individual split amount under "Split amounts" list [HOLD for payment 2024-05-20] Split scan - Split preview does not show individual split amount under "Split amounts" list May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

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

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

Copy link

melvin-bot bot commented May 13, 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:

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

@JmillsExpensify
Copy link

Re-opening for payment summary for @allroundexperts

@miljakljajic
Copy link
Contributor

@allroundexperts is owed 250 USD for their work on this issue

@JmillsExpensify
Copy link

$250 approved for @allroundexperts

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 Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
None yet
Development

No branches or pull requests