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.56k stars 2.9k forks source link

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

Closed lanitochka17 closed 9 months ago

lanitochka17 commented 10 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: 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?

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
melvin-bot[bot] commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

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

lanitochka17 commented 10 months ago

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

paultsimura commented 10 months ago

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)

melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

Upwork job price has been updated to $125

paultsimura commented 9 months ago

@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?

youssef-lr commented 9 months ago

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.

s77rt commented 9 months ago

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

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

melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

πŸ“£ @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] commented 9 months ago

πŸ“£ @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 πŸ“–

paultsimura commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

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

Christinadobrzyn commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

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:

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] commented 9 months ago

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 commented 9 months ago
Christinadobrzyn commented 9 months ago

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)

melvin-bot[bot] commented 9 months ago

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

Christinadobrzyn commented 9 months ago

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!

s77rt commented 9 months ago

@Christinadobrzyn Yes we can close this