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.36k stars 2.78k forks source link

Taxes - Error shows up when selecting tax rate in split scan menu #40755

Closed izarutskaya closed 3 months ago

izarutskaya commented 5 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.64-2 Reproducible in staging?: Y Reproducible in production?: N Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

Precondition:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a split scan.
  4. When the receipt is scanning, enter amount and merchant.
  5. Click Tax rate.
  6. Select a different tax rate.

Expected Result:

User is able to select a different tax rate without issue.

Actual Result:

Error "Unexpected error editing this expense, please try again later" shows up when selecting a different tax rate. The selected tax rate is highlighted in tax rate list, but the Tax rate row in split menu still shows the previous tax rate.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/03f0f5a3-deb0-48dd-a87e-761175796b3c

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0145ac3902090baef8
  • Upwork Job ID: 1782707567042936832
  • Last Price Increase: 2024-05-07
melvin-bot[bot] commented 5 months ago

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

melvin-bot[bot] commented 5 months ago

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

github-actions[bot] commented 5 months ago

:wave: 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.
izarutskaya commented 5 months ago

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

izarutskaya commented 5 months ago

We think this issue might be related to the #collect project.

melvin-bot[bot] commented 5 months ago

Job added to Upwork: https://www.upwork.com/jobs/~0145ac3902090baef8

melvin-bot[bot] commented 5 months ago

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

nkdengineer commented 5 months ago

Proposal

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

Error "Unexpected error editing this expense, please try again later" shows up when selecting a different tax rate. The selected tax rate is highlighted in tax rate list, but the Tax rate row in split menu still shows the previous tax rate.

What is the root cause of that problem?

We're not handling the case for edit split bill tax rate in IOURequestStepTaxRatePage so when we select a tax rate in this page, this isn't updated in confirmation page

https://github.com/Expensify/App/blob/64695c850dfd7dc054823b69f35c9511cd934cdd/src/pages/iou/request/step/IOURequestStepTaxRatePage.tsx#L70

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

Like other IOU step pages, we should subscribe splitTransactionDraft in IOURequestStepTaxRatePage and then if we're editing split bill we will get the taxRate data from splitTransactionDraft to display the selected tax rate correctly. And when we save the tax rate we will call setDraftSplitTransaction if we're editing the split bill.

https://github.com/Expensify/App/blob/64695c850dfd7dc054823b69f35c9511cd934cdd/src/pages/iou/request/step/IOURequestStepTaxRatePage.tsx#L70

We should do the same for tax amount page.

What alternative solutions did you explore? (Optional)

NA

MonilBhavsar commented 5 months ago

We can demote it from a blocker as Tax for splits is WIP here https://github.com/Expensify/App/issues/39690

Though if this is a blocker, we might have shipped some bad code related to this workflow

mountiny commented 5 months ago

Seems like we can demote based on the comment but lets make sure this is fixed fast

MonilBhavsar commented 5 months ago

This is internal issue https://expensify.slack.com/archives/C01GTK53T8Q/p1713870117792039?thread_ts=1713867930.076379&cid=C01GTK53T8Q Co assigning and looking

nkdengineer commented 5 months ago

Though if this is a blocker, we might have shipped some bad code related to this workflow

@MonilBhavsar I created a test branch for the fix here https://github.com/nkdengineer/App/tree/fix/40755, it's simple and we only use the exist function. So I think we can fix this ASAP here and we will not have the bad code. What do you think?

grgia commented 5 months ago

@MonilBhavsar seems related to https://github.com/Expensify/Auth/pull/9616

grgia commented 5 months ago

I think we need to add an early return for null/empty strings to the above linked PR @MonilBhavsar

melvin-bot[bot] commented 5 months ago

@MonilBhavsar, @grgia, @Christinadobrzyn, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick!

MonilBhavsar commented 5 months ago

@grgia sorry, could you please explain that early return case


The server error is returned because when receipt is uploded, we're still in scanning state and IOU report hasn't been created. We should be updating report optimistically, and that is being worked on https://github.com/Expensify/App/pull/40443 and then https://github.com/Expensify/App/issues/39690

melvin-bot[bot] commented 5 months ago

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

c3024 commented 5 months ago

@MonilBhavsar

From the issue

Actual Result: Error "Unexpected error editing this expense, please try again later" shows up when selecting a different tax rate. The selected tax rate is highlighted in tax rate list, but the Tax rate row in split menu still shows the previous tax rate.

The first part needs to be handled from backend. The second part needs a frontend fix as well as suggested by @nkdengineer because tax is similar to any other field like category.

cc: @grgia

Christinadobrzyn commented 4 months ago

Tracking https://github.com/Expensify/App/pull/40443 and https://github.com/Expensify/App/issues/39690

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

@MonilBhavsar @grgia @Christinadobrzyn @c3024 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!

Christinadobrzyn commented 4 months ago

Tracking https://github.com/Expensify/App/pull/40443 and https://github.com/Expensify/App/issues/39690

I wonder if this should be weekly for the time being? @c3024 @MonilBhavsar @grgia what do you think?

c3024 commented 4 months ago

Those issues do not cover Split Bill flow. So, this issue will not fixed with that PR.

melvin-bot[bot] commented 4 months ago

@MonilBhavsar @grgia @Christinadobrzyn @c3024 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!

Christinadobrzyn commented 4 months ago

Ah thank you @c3024.

@MonilBhavsar @c3024 @grgia can you confirm the best next step or a status for this? TY!

MonilBhavsar commented 4 months ago

Those issues do not cover Split Bill flow. So, this issue will not fixed with that PR.

https://github.com/Expensify/App/issues/39690 does

c3024 commented 4 months ago

Those issues do not cover Split Bill flow. So, this issue will not fixed with that PR.

39690 does

Thanks.

Sorry for the confusion @Christinadobrzyn. This can be moved to Weekly. Looks like PR for issue #39690 will take some time.

Christinadobrzyn commented 4 months ago

monitoring - https://github.com/Expensify/App/issues/39690

Christinadobrzyn commented 4 months ago

monitoring - https://github.com/Expensify/App/issues/39690

melvin-bot[bot] commented 4 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 4 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Christinadobrzyn commented 4 months ago

monitoring - https://github.com/Expensify/App/issues/39690

Christinadobrzyn commented 3 months ago

monitoring - https://github.com/Expensify/App/issues/39690

Christinadobrzyn commented 3 months ago

monitoring - https://github.com/Expensify/App/issues/39690

Just a heads up - I'm going to be ooo until June 24th. I'm not going to assign anyone new but if you need a new BZ teammate for any reason please feel free to ask for one to be assigned here.

MonilBhavsar commented 3 months ago

This bug is fixed, we can close this issue