Skip to content

[$250] [HOLD for payment 2024-05-06] Group split scan - Error appears for Merchant when clicking Split expense for the second time #40749

Closed

Description

@kavimuru

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.64-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: n/a
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 FAB > Split expense > Scan.
  3. Create split scan expense with a few users.
  4. In group chat, click on the split preview.
  5. Click Split expense.
  6. Click Split expense again.

Expected Result:

There will be no error under Merchant field because Merchant is not a requirement for non-workspace expense.

Actual Result:

Error shows up under Merchant field when clicking Split expense for the second time.

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

Bug6458020_1713821712347.20240423_053140.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013158f9aa7567f244
  • Upwork Job ID: 1790113061570207744
  • Last Price Increase: 2024-05-13
Issue OwnerCurrent Issue Owner: @

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Apr 23, 2024
  2. melvin-bot commented on Apr 23, 2024

    @melvin-bot

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

  3. melvin-bot commented on Apr 23, 2024

    @melvin-bot

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

  4. github-actions commented on Apr 23, 2024

    @github-actions
    Contributor

    👋 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.
  5. kavimuru commented on Apr 23, 2024

    @kavimuru
    Author

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

  6. kavimuru commented on Apr 23, 2024

    @kavimuru
    Author

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

  7. allgandalf commented on Apr 23, 2024

    @allgandalf
    Contributor

    Proposal

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

    Error appears for merchant even when it is not required for non workspace expenses

    What is the root cause of that problem?

    This is a regression from #38543, Here we have added a new condition to display merchant error:

    if ((isMerchantRequired && isMerchantEmpty) || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null))) {
    setMerchantError(true);
    return;

    The second part of this condition would return true when we the merchant is empty and shouldDisplayFieldError would be set to true the first time we click on submit button because the amount field is empty.

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

    We need to add a extra && check of isMerchantRequired, so that we only set the error to true if the merchant is required:

    diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx
    index 99901dd261..87d605a7a5 100755
    @@ -577,7 +577,7 @@ function MoneyRequestConfirmationList({
                 if (selectedParticipants.length === 0) {
                     return;
                 }
    -            if ((isMerchantRequired && isMerchantEmpty) || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null))) {
    +            if ((isMerchantRequired && isMerchantEmpty) || (isMerchantRequired && shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null))) {
                     setMerchantError(true);
                     return;
                 }
    

    What alternative solutions did you explore? (Optional)

  8. saifelance commented on Apr 23, 2024

    @saifelance

    @GandalfGwaihir
    We should modify the condition to ensure that the error is set to true only if the merchant is required. So, an additional && check for isMerchantRequired needs to be added. This adjustment ensures that the error is set only when the merchant is both required and empty:

    `diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx
    index 99901dd261..87d605a7a5 100755
    @@ -577,7 +577,7 @@ function MoneyRequestConfirmationList({
    if (selectedParticipants.length === 0) {
    return;
    }

    •        if ((isMerchantRequired && isMerchantEmpty) || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null))) {
      
    •        if ((isMerchantRequired && isMerchantEmpty) || (isMerchantRequired && shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null))) {
                 setMerchantError(true);
                 return;
             }
      

    `

  9. 38 remaining items

  10. johncschuster commented on May 15, 2024

    @johncschuster
    Contributor

    @Ollyws, I see you've just been added to the list of contributors who can accept payment via NewDot. I'll go ahead and post a payment summary instead so you can be paid via that method.

  11. johncschuster commented on May 15, 2024

    @johncschuster
    Contributor

    Payment Summary

    Contributor+: @Ollyws - $250 via Manual Request

  12. johncschuster commented on May 16, 2024

    @johncschuster
    Contributor

    @robertjchen can you complete the BZ checklist above?

  13. Ollyws commented on May 17, 2024

    @Ollyws
    Contributor

    Requested in ND, thanks!

  14. JmillsExpensify commented on May 19, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @Ollyws

  15. robertjchen commented on May 20, 2024

    @robertjchen
    Contributor

    Working through checklist

  16. added
    Weekly
    and removed
    Awaiting Payment
    on May 30, 2024
  17. johncschuster commented on Jun 7, 2024

    @johncschuster
    Contributor

    Bumping this for Melvin. How's the checklist going, Robert?

  18. robertjchen commented on Jun 10, 2024

    @robertjchen
    Contributor

    @johncschuster Made my assessment, and left the last item for you 👍

  19. johncschuster commented on Jun 10, 2024

    @johncschuster
    Contributor

    Thanks @robertjchen! Looks like we can close this up!

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

Metadata

Metadata

Labels

BugEngineeringExternalWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions