Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.53k stars 2.88k forks source link

[$250] Scan – RBR is not displayed in LHN when editing an amount to be higher than the scanned amount #47411

Closed lanitochka17 closed 1 month ago

lanitochka17 commented 2 months ago

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: 9.0.20-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/4856399 Email or phone of affected tester (no customers): htad26+dfdskffdgfh@gmail.com Issue reported by: Applause - Internal Team

Action Performed:

Prerequisite Have a workspace and invite a member (Employee) to the workspace

  1. As the employee navigate to the workspace chat
  2. Click on + icon > Submit expense > Scan
  3. Upload a digital receipt > Submit > Wait for the smart scan to be completed
  4. Once the smart scan is finished navigate to the expense details
  5. Click on the amount > edit the amount to be higher than the scanned amount > Save
  6. Notice that after a while a violation is displayed indicating the amount is higher than the scanned receipt
  7. Now observe the LHN of the workspace chat

Expected Result:

RBR is displayed in the expense and LHN

Actual Result:

RBR is not displayed in LHN

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/24cbf938-978d-4ab6-bafe-130ca18e5ec0

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0124127bfc33770a35
  • Upwork Job ID: 1824242806372548696
  • Last Price Increase: 2024-08-16
  • Automatic offers:
    • rojiphil | Reviewer | 103558418
Issue OwnerCurrent Issue Owner: @rojiphil
melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @mallenexpensify (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 commented 2 months ago

@mallenexpensify 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 commented 2 months ago

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

bernhardoj commented 2 months ago

Proposal

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

RBR is not displayed when the receipt has an error of amount is bigger than the receipt amount.

What is the root cause of that problem?

When we have a violation of the unmatched data with the receipt, the violation type will be a NOTICE.

image

Currently, the RBR will only show if the violation type is either a VIOLATION or a WARNING. https://github.com/Expensify/App/blob/27e62e7f72e8f6cf8a9c57f49998d8aa307cdde5/src/libs/ReportUtils.ts#L5759

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

Maybe it's expected to ignore the NOTICE type violation, but if we want to change this, then we can include checking the NOTICE type violation.

 || TransactionUtils.hasNoticeTypeViolation(IOUTransactionID, transactionViolations)

Or we can be more specific to check if it's a NOTICE violation and also a modifiedAmount or modifiedDate violation name.

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

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

mallenexpensify commented 2 months ago

I think I was able to repro. One thing I don't understand - After creating the expense, I see the Expense Report chat in LHN (cuz the report is in the main pane). Once I click away, I don't see the Expense Report in LHN.

image

I see this, and when I click into the report, it shows in LHN while it's open then hides once I click another chat in LHN

image

@rojiphil can you attempt reproduction and comment on my observation above? Thx

rojiphil commented 2 months ago

when I click into the report, it shows in LHN while it's open then hides once I click another chat in LHN

can you attempt reproduction and comment on my observation above? Thx

@mallenexpensify I think it is designed to hide unless it is pinned or if there is GBR/RBR. Once we fix this issue, the RBR will be enabled which will ensure that the report remains in LHN.

rojiphil commented 2 months ago

@bernhardoj proposal RCA makes sense. I like the proposed solution of fixing it by checking the NOTICE violation type and modifiedAmount/modifiedDate violation name. This will additionally fix the issue with modifiedDate. 🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

📣 @rojiphil 🎉 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

bernhardoj commented 2 months ago

PR is ready

cc: @rojiphil

IuliiaHerets commented 2 months ago

This PR is failing for Desktop because of issue #48147

bernhardoj commented 2 months ago

I have opened a new PR to address https://github.com/Expensify/App/issues/48147.

rojiphil commented 2 months ago

This PR is failing for Desktop because of issue #48147

The mentioned issue is a non-issue as it is already closed here

rojiphil commented 2 months ago

I have opened a new PR to address https://github.com/Expensify/App/issues/48147.

@bernhardoj Do we still need this PR considering that the mentioned issue is closed?

bernhardoj commented 2 months ago

Oh, shoot. I didn't realize it was closed. I believe we still need to fix it because the RBR shows in LHN but no error message is shown in the report.

rojiphil commented 2 months ago

I believe we still need to fix it because the RBR shows in LHN but no error message is shown in the report.

Yeah. A BE issue though but we can make it consistent in FE. Will review soon.

melvin-bot[bot] commented 1 month ago

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

mallenexpensify commented 1 month ago

@adelekennedy I'm out til Tuesday, can you keep 👀 on plz? Thx

melvin-bot[bot] commented 1 month ago

@francoisl, @rojiphil, @mallenexpensify, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 1 month ago

@francoisl, @rojiphil, @mallenexpensify, @bernhardoj Still overdue 6 days?! Let's take care of this!

francoisl commented 1 month ago

This must have been on production for a while now (staging deploy was Sept 9), I think the automation for the production didn't work. @mallenexpensify let's issue the payments now and close this.

mallenexpensify commented 1 month ago

Contributor: @bernhardoj owed $250 via NewDot Contributor+: @rojiphil paid $250 via Upwork.

@rojiphil plz complete the BZ checklist.

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:

JmillsExpensify commented 1 month ago

$250 approved for @bernhardoj

rojiphil commented 1 month ago

Steps: 1 Submit a scan request with a receipt that has a date 2 Wait until the smartscan is finished. Make sure there is no error with the request 3 Edit the amount to be higher than the original amount 4 (for small screen) Go back to LHN 5 Verify there is an RBR on the money request report/thread 6 Reset the amount back to the original 7 Edit the date 8 (for small screen) Go back to LHN 9 Verify there is an RBR on the money request report/thread

rojiphil commented 1 month ago

@mallenexpensify BZ checklist done. Thanks

mallenexpensify commented 1 month ago

Thanks @rojiphil test case created