App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-02-09] [$125] Split - Error message for merchant required is displayed on failed split in group DM

Open lanitochka17 opened this issue 1 year ago β€’ 20 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.29-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/4211016 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:

Re-requisite: user must have created a group and created a Split bill that will fail

  1. Go to group DM
  2. Click on the Split bill preview (the one that failed)
  3. Scroll down to Merchant field

Expected Result:

Error message for merchant required should not appear, since merchant is not a requirement outside workspace expense

Actual Result:

Error message for merchant required is displayed

Workaround:

Unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [x] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/ac465591-c9bd-43ee-9dab-c934db68952d

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c87576e15c9b6373
  • Upwork Job ID: 1749514046195736576
  • Last Price Increase: 2024-01-23
  • Automatic offers:
    • s77rt | Reviewer | 28120335
    • paultsimura | Contributor | 28120336

lanitochka17 avatar Jan 22 '24 19:01 lanitochka17

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

melvin-bot[bot] avatar Jan 22 '24 19:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 22 '24 19:01 melvin-bot[bot]

We think that this bug might be related to #vip-split-p2p-chat-groups

lanitochka17 avatar Jan 22 '24 19:01 lanitochka17

Proposal

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

The Merchant Required error is shown for split requests outside of an Expense report.

What is the root cause of that problem?

We do not properly check if the request belongs to the Policy Expense Chat while showing the merchant error here:

https://github.com/Expensify/App/blob/61c7e0bcddac907b50e3600ff651655c5eb8d2e1/src/components/MoneyRequestConfirmationList.js#L714-L715

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

We should display this error only if the report belongs to the Expense Chat by adding a props.isPolicyExpenseChat check:

brickRoadIndicator={props.isPolicyExpenseChat && shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''}
error={shouldDisplayMerchantError || (props.isPolicyExpenseChat && shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction)) ? translate('common.error.enterMerchant') : ''}

This can be a bit simplified by moving this whole check into a separate variable and reusing it, but the general idea is the same.

We are making the same check on the MoneyRequestView here:

https://github.com/Expensify/App/blob/5e710377c42462f7fb4266677619fc29d5092c5b/src/components/ReportActionItem/MoneyRequestView.js#L316-L317

What alternative solutions did you explore? (Optional)

paultsimura avatar Jan 22 '24 19:01 paultsimura

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

melvin-bot[bot] avatar Jan 23 '24 14:01 melvin-bot[bot]

Upwork job price has been updated to $125

melvin-bot[bot] avatar Jan 23 '24 14:01 melvin-bot[bot]

@youssef-lr wouldn't it be fair to make the bounty for this one equal to the other almost identical issue – https://github.com/Expensify/App/issues/33876? What's the difference between these 2 issues?

paultsimura avatar Jan 23 '24 15:01 paultsimura

I think that bug is more important. Merchant is required when smartscan fails, especially in workspaces that are being actively used. Right now, P2P splits haven't really fully launched.

youssef-lr avatar Jan 23 '24 18:01 youssef-lr

@paultsimura Thanks for the proposal. Your RCA is correct. The solution looks good to me.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed Link to proposal

s77rt avatar Jan 23 '24 23:01 s77rt

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

melvin-bot[bot] avatar Jan 23 '24 23:01 melvin-bot[bot]

πŸ“£ @s77rt πŸŽ‰ 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

melvin-bot[bot] avatar Jan 24 '24 21:01 melvin-bot[bot]

πŸ“£ @paultsimura πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Jan 24 '24 21:01 melvin-bot[bot]

Thanks. The PR is ready for review: https://github.com/Expensify/App/pull/35112

paultsimura avatar Jan 24 '24 22:01 paultsimura

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

melvin-bot[bot] avatar Feb 01 '24 21:02 melvin-bot[bot]

Gonna move this to weekly while the PR is reviewed. Feel free to let me know if you'd prefer it stay daily.

Christinadobrzyn avatar Feb 01 '24 23:02 Christinadobrzyn

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

melvin-bot[bot] avatar Feb 02 '24 15:02 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.35-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/35112

If no regressions arise, payment will be issued on 2024-02-09. :confetti_ball:

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

melvin-bot[bot] avatar Feb 02 '24 15:02 melvin-bot[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:

  • [ ] [@s77rt] The PR that introduced the bug has been identified. Link to the PR:
  • [ ] [@s77rt] 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:
  • [ ] [@s77rt] 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:
  • [ ] [@s77rt] Determine if we should create a regression test for this bug.
  • [x] [@s77rt] 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.
  • [x] [@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

melvin-bot[bot] avatar Feb 02 '24 15:02 melvin-bot[bot]

  • The PR that introduced the bug has been identified: https://github.com/Expensify/App/pull/29064
  • The offending PR has been commented on: https://github.com/Expensify/App/pull/29064#discussion_r1477581987
  • A discussion in #expensify-bugs has been started: Not needed. This does not seem like the type of bug that could resurface
  • Determine if we should create a regression test for this bug: Seeing that this came from a regression test, we may not need another one

s77rt avatar Feb 05 '24 02:02 s77rt

Payouts due:

Contributor: $125 @paultsimura (in Upwork - https://www.upwork.com/nx/wm/offer/28120336) Contributor+: $125 @s77rt (in Upwork - https://www.upwork.com/nx/wm/offer/28120335)

Christinadobrzyn avatar Feb 07 '24 00:02 Christinadobrzyn

@cead22, @paultsimura, @s77rt, @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Feb 12 '24 15:02 melvin-bot[bot]

Sorry for the delay - paid out based on this payment summary - https://github.com/Expensify/App/issues/34914#issuecomment-1931015902

It sounds like we don't need a regression test for this, correct @s77rt? If that's the case, I'll close this out. Thanks!

Christinadobrzyn avatar Feb 12 '24 18:02 Christinadobrzyn

@Christinadobrzyn Yes we can close this

s77rt avatar Feb 12 '24 19:02 s77rt