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

[$500] Scan receipts- After admin approves request with error, RD still present in LHN #38219

Closed
1 of 6 tasks
izarutskaya opened this issue Mar 13, 2024 · 14 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

Comments

@izarutskaya
Copy link

izarutskaya commented Mar 13, 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.51-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: https://expensify.testrail.io/index.php?/tests/view/4418424
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Open the App
  2. Start the request money flow > "Scan" receipt
  3. Upload a blurry receipt
  4. Complete the money request flow
  5. While the receipt is scanning - navigate to the request conversation
  6. Manually edit the amount field
  7. Leave the merchant field empty,so it shows an error to "Enter a merchant"
  8. As the admin - Mark the expense as approved

Expected Result:

The red dot is removed from the report preview, from the LHN conversation and the expense details.

Actual Result:

After approval, the red dot is still present in the report preview, the LHN conversation and the expense details.

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

Bug6412075_1710323044630.RDafterapprove.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f659429db634ed75
  • Upwork Job ID: 1769848374606114816
  • Last Price Increase: 2024-03-25
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

@izarutskaya
Copy link
Author

@johncschuster 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 that this bug might be related to #wave-collect - Release 1
CC @trjExpensify

@bernhardoj
Copy link
Contributor

Proposal

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

The red dot still shows in LHN even after the admin approves the request.

What is the root cause of that problem?

Currently, we check for any smart scan error in all report actions.

} else if (ReportUtils.hasSmartscanError(Object.values(reportActions ?? {}))) {
reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage');
}

We will show the error if there a missing fields and the request is not settled yet, but we never check whether it's approved or not.

const isReportPreviewError = ReportActionsUtils.isReportPreviewAction(action) && hasMissingSmartscanFields(IOUReportID) && !isSettled(IOUReportID);

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

Add the approved state check and don't show the error if it's approved.

&& !isReportApproved(IOUReportID)

We will do the same for report preview.

const shouldShowRBR = !iouSettled && hasErrors;

@trjExpensify
Copy link
Contributor

I think this is more violations related. @JmillsExpensify, did we land on removing the RBR on approval but keeping the error in-line within the expense?

@nkdengineer
Copy link
Contributor

nkdengineer commented Mar 13, 2024

Proposal

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

After approval, the red dot is still present in the report preview, the LHN conversation and the expense details.

What is the root cause of that problem?

We show the error for policy expense chat in LHN if at least one report preview action or split bill action has smart scan error

} else if (ReportUtils.hasSmartscanError(Object.values(reportActions ?? {}))) {
reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage');
}
// All error objects related to the report. Each object in the sources contains error messages keyed by microtime

In this function we missed to check the report is approved or not

const isReportPreviewError = ReportActionsUtils.isReportPreviewAction(action) && hasMissingSmartscanFields(IOUReportID) && !isSettled(IOUReportID);

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

  1. Add the check !isReportApproved(IOUReportID) here

const isReportPreviewError = ReportActionsUtils.isReportPreviewAction(action) && hasMissingSmartscanFields(IOUReportID) && !isSettled(IOUReportID);

  1. After add the check above, with the test steps of the issue, the red dot still appears because the whisper split action that doesn't appear in ReportScreen of admin has error after scanning completely and we don't remove this to the list action need to check.

To fix this case, we should check if the report action is not visible we will return false here

 if ((!ReportActionsUtils.isSplitBillAction(action) && !ReportActionsUtils.isReportPreviewAction(action)) || !ReportActionsUtils.shouldReportActionBeVisible(action, key)) {

App/src/libs/ReportUtils.ts

Lines 5065 to 5067 in fa6bcc0

if (!ReportActionsUtils.isSplitBillAction(action) && !ReportActionsUtils.isReportPreviewAction(action)) {
return false;
}

  1. We should add the check !isReportApproved(iouReportID) in ReportPreview and MoneyRequestPreviewContext to prevent show the error when it's approved as well.

const shouldShowRBR = !iouSettled && hasErrors;

What alternative solutions did you explore? (Optional)

NA

@johncschuster
Copy link
Contributor

Thanks for calling out that this is likely related to #wave-control, @trjExpensify! I've added it to the project tracker and raised it in Slack. 👍

@melvin-bot melvin-bot bot added the Overdue label Mar 18, 2024
Copy link

melvin-bot bot commented Mar 18, 2024

@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!

@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Mar 18, 2024
@melvin-bot melvin-bot bot changed the title Scan receipts- After admin approves request with error, RD still present in LHN [$500] Scan receipts- After admin approves request with error, RD still present in LHN Mar 18, 2024
Copy link

melvin-bot bot commented Mar 18, 2024

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

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

melvin-bot bot commented Mar 18, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Mar 18, 2024
@johncschuster
Copy link
Contributor

Not overdue. I've just triaged this one out.

@JmillsExpensify
Copy link

We should close the issue. It's being handled here instead: #34548

@melvin-bot melvin-bot bot added the Overdue label Mar 23, 2024
Copy link

melvin-bot bot commented Mar 25, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@johncschuster
Copy link
Contributor

Closing in favor of #34548. Thanks for the heads up, @JmillsExpensify!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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
Projects
Status: Done
Development

No branches or pull requests

7 participants