Skip to content

[HOLD for payment 2024-06-03] [$250] Expense - Merchant shows "Expense" when merchant is filled then removed when creating expense #41939

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.72-0
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Submit expense.
  3. Submit a manual expense without merchant.
  4. Go to transaction thread.
  5. Note that Merchant row remains empty.
  6. Go to FAB > Submit expense > Manual.
  7. Enter amount > Next > Select user.
  8. On confirmation page, enter a merchant and save it.
  9. Clear the merchant field and save it.
  10. Submit the expense.
  11. Go to transaction thread.

Expected Result:

Merchant row will remain empty because the expense is submitted without merchant.

Actual Result:

Merchant row is populated with "Expense" when merchant field is filled then removed when submitting the expense.

Workaround:

n/a

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

Bug6476090_1715268811635.20240509_232837.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01282159a7ab4f2452
  • Upwork Job ID: 1789699817742114816
  • Last Price Increase: 2024-05-12
  • Automatic offers:
    • ikevin127 | Reviewer | 0
    • bernhardoj | Contributor | 0
Issue OwnerCurrent Issue Owner: @MitchExpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 9, 2024
  2. melvin-bot commented on May 9, 2024

    @melvin-bot

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

  3. kbecciv commented on May 9, 2024

    @kbecciv
    Author

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

  4. kbecciv commented on May 9, 2024

    @kbecciv
    Author

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

  5. bernhardoj commented on May 10, 2024

    @bernhardoj
    Contributor

    Proposal

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

    When submtting a new expense with an empty merchant that is previously filled, the merchant shows Expense.

    What is the root cause of that problem?

    When we start a new money request flow, the default merchant is (none). If it's (none), we show nothing in the merchant field. If we submit an expense with a merchant of (none), the merchant stays as (none).

    If we set the merchant to something else first, for example "test", then the transaction draft merchant becomes "test".
    merchant: 'test'
    Then, if we clear it, then it becomes empty string.
    merchant: ''

    If we submit an expense with an empty string of merchant, the BE response will return "Expense" as the merchant.
    image

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

    Fallback to (none) if the merchant is empty, just like what we did for edit case.

    if (isEditing) {
    // When creating a new expense, newMerchant can be blank so we fall back on PARTIAL_TRANSACTION_MERCHANT
    IOU.updateMoneyRequestMerchant(transactionID, reportID, newMerchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, policy, policyTags, policyCategories);

  6. nkdengineer commented on May 10, 2024

    @nkdengineer
    Contributor

    Proposal

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

    Merchant row is populated with "Expense" when merchant field is filled then removed when submitting the expense.

    What is the root cause of that problem?

    The default merchant is (none). But when we clear a merchant and save, we store it as empty string and then BE returns it as expense.

    IOU.setMoneyRequestMerchant(transactionID, newMerchant ?? '', !isEditing);

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

    For the create flow and edit split bill, we should fallback the merchant to CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT when we save it

    IOU.setDraftSplitTransaction(transactionID, {merchant: newMerchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT});
    

    IOU.setDraftSplitTransaction(transactionID, {merchant: newMerchant});

    IOU.setMoneyRequestMerchant(transactionID, newMerchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, !isEditing);
    

    IOU.setMoneyRequestMerchant(transactionID, newMerchant ?? '', !isEditing);

    Beside, we shouldn't also call IOU.setMoneyRequestMerchant for the edit flow.

    What alternative solutions did you explore? (Optional)

    NA

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 12, 2024
  8. melvin-bot commented on May 12, 2024

    @melvin-bot
  9. changed the title [-]Expense - Merchant shows "Expense" when merchant is filled then removed when creating expense[/-] [+][$250] Expense - Merchant shows "Expense" when merchant is filled then removed when creating expense[/+] on May 12, 2024
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 12, 2024
  11. melvin-bot commented on May 12, 2024

    @melvin-bot

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

  12. 18 remaining items

  13. changed the title [-][$250] Expense - Merchant shows "Expense" when merchant is filled then removed when creating expense[/-] [+][HOLD for payment 2024-06-03] [$250] Expense - Merchant shows "Expense" when merchant is filled then removed when creating expense[/+] on May 27, 2024
  14. melvin-bot commented on May 27, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on May 27, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.75-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-06-03. 🎊

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

  16. melvin-bot commented on May 27, 2024

    @melvin-bot

    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:

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

    @MitchExpensify
    Contributor

    Reminder set to pay on the 3rd. @ikevin127 - Thoughts on the testing stesps?

  18. ikevin127 commented on May 30, 2024

    @ikevin127
    Contributor

    Thanks! Sure, I'll complete the checklist tomorrow (PST), making sure to include regression test 👍

  19. ikevin127 commented on May 30, 2024

    @ikevin127
    Contributor

    No need to take additional steps or update the PR review checklist as this issue happened during TS migration because functionality was changed without carefully considering / testing the logic, when this shouldn't have happened in the first place.

    • [@ikevin127] Determine if we should create a regression test for this bug.
    • [@ikevin127] 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.

    Regression Test Proposal

    1. Go to https://staging.new.expensify.com.
    2. Go to FAB > Submit expense.
    3. Submit a manual expense without merchant.
    4. Go to transaction thread.
    5. Note that Merchant row remains empty.
    6. Go to FAB > Submit expense > Manual.
    7. Enter amount > Next > Select user.
    8. On confirmation page, enter a Merchant and save it.
    9. Go back to the Merchant field, clear the Merchant and save it.
    10. Submit the expense.
    11. Go to transaction thread.
    12. Verify the Merchant field stays empty.

    Do we agree 👍 or 👎.

  20. MitchExpensify commented on Jun 3, 2024

    @MitchExpensify
    Contributor

    Payment summary:

  21. MitchExpensify commented on Jun 3, 2024

    @MitchExpensify
    Contributor

    Paid and contracts ended

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions