Skip to content

[$500] Scan - Unknown Merchant is shown instead of error when leaving scanning to fail in details page #34438

Closed

Description

@kbecciv

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.24-7
Reproducible in staging?: y
Reproducible in production?: y
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 workspace chat.
  2. Create a scan request with receipt that will fail the scanning.
  3. Go to details page while it is still scanning.
  4. Wait for it to fail.

Expected Result:

When the scanning fails, "Enter a merchant name" message will appear on Merchant row.

Actual Result:

When the scanning fails, it shows "Unknown Merchant" in Merchant field.
When user returns to the report and back to details page, "Unknown Merchant" disappears and it is replaced with "Enter a merchant name" message.

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

Bug6340066_1705060282853.bandicam_2024-01-12_02-30-06-211__1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f64fe18fc04bd638
  • Upwork Job ID: 1745791608083116032
  • Last Price Increase: 2024-01-12

Activity

  1. added
    External
    Daily
    Bug
    on Jan 12, 2024
  2. changed the title [-]Scan - Unknown Merchant is shown instead of error when leaving scanning to fail in details page[/-] [+][$500] Scan - Unknown Merchant is shown instead of error when leaving scanning to fail in details page[/+] on Jan 12, 2024
  3. melvin-bot commented on Jan 12, 2024

    @melvin-bot
  4. melvin-bot commented on Jan 12, 2024

    @melvin-bot

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

  5. added
    Help Wanted
    on Jan 12, 2024
  6. melvin-bot commented on Jan 12, 2024

    @melvin-bot

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

  7. DylanDylann commented on Jan 12, 2024

    @DylanDylann
    Contributor

    Proposal

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

    When the scanning fails, it shows "Unknown Merchant" in Merchant field.
    When user returns to the report and back to details page, "Unknown Merchant" disappears and it is replaced with "Enter a merchant name" message.

    What is the root cause of that problem?

    In this case, The BE return "Unknown Merchant"
    But in here don't check is transactionMerchant is "Unknown Merchant"

    const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

    so the isEmptyMerchant is false

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

    const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

    we should return isEmptyMerchant is true if transactionMerchant is "Unknown Merchant"

        const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || transactionMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT;
    
    

    Optional:

    function isMerchantMissing(transaction: Transaction) {
    const isMerchantEmpty = transaction.merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || transaction.merchant === '';

    We also should update here by adding the condition to check || transactionMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT;

    What alternative solutions did you explore? (Optional)

  8. Shubham1429 commented on Jan 12, 2024

    @Shubham1429

    Proposal

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

    If the user is on the details page of a scan request and the scanning fails, then it shows UNKOWN MERCHANT instead of the usual error message i.e Enter a merchant name. If the user goes back and then opens the details page again, then he can see the appropriate error message.

    What is the root cause of that problem?

    If the scanning fails, merchant is returned as Unknown Merchant and in the MoneyRequestView.js file there is no check for that particular value.

    const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

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

    Create a new function in TransactionUtils.ts file that checks if the merchant is empty, (none) or unknown and use it in line 141 of MoneyRequestView.js file.

    function isEmptyMerchant(transaction: Transaction) {
        return transaction.merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || transaction.merchant === CONST.TRANSACTION.UNKNOWN_MERCHANT || transaction.merchant === ''
    }

    What alternative solutions did you explore? (Optional)

    We can also just add the unknown merchant check in the existing condition.

    Eg:

        const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || transactionMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT;
  9. mollfpr commented on Jan 12, 2024

    @mollfpr
    Contributor

    @kbecciv @abekkala, I need help understanding the expected result more. This PR #26155 shows the Unknown Merchant value in Merchant input and the red dot error.

    Screenshot 2024-01-13 at 00 10 54

    Should we empty the input while showing the error or keep the Unknown Merchant value?


    Another issue with the money request preview is that it briefly shows the Unknown Merchant value.

  10. melvin-bot commented on Jan 15, 2024

    @melvin-bot

    @abekkala, @mollfpr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. abekkala commented on Jan 17, 2024

    @abekkala
    Contributor

    When the scanning fails, it shows "Unknown Merchant" in Merchant field.

    This is expected with the SmartScan feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions