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.03k stars 2.54k forks source link

[$250] [CVP] New User who is submitted an IOU pays via BBA, then see’s `Approve' #42322

Open m-natarajan opened 2 weeks ago

m-natarajan commented 2 weeks 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.74-4 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: @danielrvidal Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1715816298574129

Action Performed:

  1. As user A send a IOU request to new user
  2. Click "Pay" from the new user email
  3. User is taken to the IOU report
  4. Select the option "Pay with expensify"
  5. Select option "Business bank account"
  6. This will create a workspace and moves the IOU to a workspace chat
  7. Cancel the VBBA set up and navigate to the workspace chat

Expected Result:

The expense should see payrather than approve.

Actual Result:

There is an option to approve the expense, even though it’s a brand new workspace and thus shouldn’t have approval.

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/38435837/75e30b41-82a9-4adc-aa72-0320aee34db4

https://github.com/Expensify/App/assets/38435837/98fc8878-c3e5-4d89-9ee5-a4fb07a0587b

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cc2fb178d0dea7a3
  • Upwork Job ID: 1792680301683040256
  • Last Price Increase: 2024-05-27
Issue OwnerCurrent Issue Owner: @hoangzinh
melvin-bot[bot] commented 2 weeks ago

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

bernhardoj commented 2 weeks ago

Proposal

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

The money request preview shows approve button even though it's a new workspace which has approval disabled by default.

What is the root cause of that problem?

This has the same root cause as https://github.com/Expensify/App/issues/39171.

We already have a condition here to not show the approve button if the approval is disabled (isOnSubmitAndClosePolicy).

https://github.com/Expensify/App/blob/e8ae3c5acedf0e6788dc574c7b6f3043ca37092a/src/libs/actions/IOU.ts#L5978-L5982

However, the auto-reporting frequency needs to be instant (isOnInstantSubmitPolicy) to not show the approval button. In our case, the frequency is set to WEEKLY, so the condition is never met.

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

Remove isOnInstantSubmitPolicy condition

Or change the condition to accept either isOnInstantSubmitPolicy or isOnSubmitAndClosePolicy. if (isOnInstantSubmitPolicy || isOnSubmitAndClosePolicy) {

We need to fix on the BE too because the next step indicating for the admin to approve it first.

melvin-bot[bot] commented 1 week ago

@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick!

kevinksullivan commented 1 week ago

This is bottom up case, so adding to collect project

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

DylanDylann commented 1 week ago

This RCA and solution of this issue is similar to this one that I approved @bernhardoj's proposal https://github.com/Expensify/App/issues/39171#issuecomment-2029805915. @kevinksullivan Do you think we should close this one and reopen the previous issue to save effort because both I and @bernhardoj have context about this problem?

hoangzinh commented 1 week ago

Do you think we should close this one and reopen https://github.com/Expensify/App/issues/39171

I don't think we should. The previous issue is closed because that issue is not reproducible, if we re-open that issue, the reproduce steps there can't be used, also expectation.

But I'm happy to let @DylanDylann continuous review this issue as a C+.

melvin-bot[bot] commented 5 days ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 4 days ago

@hoangzinh, @kevinksullivan Huh... This is 4 days overdue. Who can take care of this?

hoangzinh commented 4 days ago

cc @kevinksullivan what do you think on my comment here https://github.com/Expensify/App/issues/42322#issuecomment-2127459065

melvin-bot[bot] commented 2 days ago

@hoangzinh @kevinksullivan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!