Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-04-25] Taxes - id_TAX_EXEMPT appears in the list when there are more than 8 tax rates #39825

Closed
5 of 6 tasks
lanitochka17 opened this issue Apr 8, 2024 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering

Comments

@lanitochka17
Copy link

lanitochka17 commented Apr 8, 2024

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.61-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
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Collect workspace has more than 8 tax rates
  • Tax exempt (0%) is the workspace currency default
  1. Go to staging.new.expensify.com
  2. Go to Collect workspace chat
  3. Start manual request flow
  4. In confrimation page, click Show more > Taxes

Expected Result:

The selected default tax exempt will appear on top

Actual Result:

id_TAX_EXEMPT appears at the top of the list. This issue only occurs when there are more than 8 tax rates

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

Bug6442199_1712581120324.tax.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

Copy link
Contributor

github-actions bot commented Apr 8, 2024

👋 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.

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@lanitochka17
Copy link
Author

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

@allgandalf
Copy link
Contributor

allgandalf commented Apr 8, 2024

Regression from #39059, you take the value of default tax rate as default external ID:

const defaultTaxKey = taxRates?.defaultExternalID;

But, in api response the default external ID is:

image

And the when we select the selected tax rate:

const selectedTaxRate = transaction?.taxRate?.keyForList || defaultTaxKey;

We check for transaction?.taxRate?.keyForList if it exists, but the api response doesn't have such field IMO.

We should instead do:

const selectedTaxRate = TransactionUtils.getDefaultTaxName(taxRates, transaction);

@rlinoz
Copy link
Contributor

rlinoz commented Apr 8, 2024

@SzymczakJ @jjcoffee are you able to take a look at this?

@srikarparsi
Copy link
Contributor

srikarparsi commented Apr 8, 2024

Working on testing if reverting the TS migration fixes the issue. VM is having some problems so taking a bit.

@srikarparsi
Copy link
Contributor

Able to reproduce on latest main:

image

Trying to roll back TS migration and test again.

@srikarparsi
Copy link
Contributor

Hey @luacmartins and @MonilBhavsar, saw that you demoted this tax issue since it's coming from a new feature. This one seems very related as the code that's causing the discrepancy is selectedTaxRate. Should we demote this one as well?

I'm currently working on trying to revert the TS Migration PR in case it's related to that but am not able to do it on Web so trying to do it locally. But wanted to ask in the meantime.

@srikarparsi
Copy link
Contributor

Figured out a fix here

@srikarparsi
Copy link
Contributor

Checked to see if any C+ is able to review the fix

@srikarparsi
Copy link
Contributor

Still looking at this, I've been having VM problems so it's taking a little longer. Thought I had resolved them but still occurring.

@srikarparsi
Copy link
Contributor

I narrowed it down to this sections variable. When printed, it has id_TAX_EXEMPT as it's own sections and the remaining taxes in a different section.

I also found that when you select a different tax value and then the default tax exempt one, the bug no longer exists. So maybe it's something to do with a different id?

@srikarparsi
Copy link
Contributor

The bug also doesn't exist for less than 8 tax rates because of this block here

@teneeto
Copy link
Contributor

teneeto commented Apr 9, 2024

Hi, I'm Eto from Callstack - expert contributor group - and I would like to take care of this issue.

@teneeto
Copy link
Contributor

teneeto commented Apr 9, 2024

This issue is currently handled in this PR: #39723

@srikarparsi
Copy link
Contributor

Ah cool, see that you had a similar fix

const moneyRequestSelectedTaxRate = transaction?.taxRate?.keyForList || (taxRates && TransactionUtils.getDefaultTaxName(taxRates));

Assigning you to the issue

@MonilBhavsar
Copy link
Contributor

Demoting this issue from blocker, as we need to have atleast 8 tax options and it's a specific case.

@MonilBhavsar MonilBhavsar removed the DeployBlockerCash This issue or pull request should block deployment label Apr 9, 2024
@teneeto
Copy link
Contributor

teneeto commented Apr 9, 2024

PR is merged

Copy link

melvin-bot bot commented Apr 10, 2024

⚠️ 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 melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 18, 2024
@melvin-bot melvin-bot bot changed the title Taxes - id_TAX_EXEMPT appears in the list when there are more than 8 tax rates [HOLD for payment 2024-04-25] Taxes - id_TAX_EXEMPT appears in the list when there are more than 8 tax rates Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

If no regressions arise, payment will be issued on 2024-04-25. 🎊

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 24, 2024
Copy link

melvin-bot bot commented Apr 25, 2024

Issue is ready for payment but no BZ is assigned. @puneetlath you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

Copy link

melvin-bot bot commented Apr 25, 2024

Payment Summary

Upwork Job

  • Contributor: @teneeto is from an agency-contributor and not due payment
  • Reviewer: @allroundexperts owed $250 via NewDot

BugZero Checklist (@puneetlath)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@puneetlath
Copy link
Contributor

Payment summary:

Thanks everyone!

@JmillsExpensify
Copy link

$250 approved for @allroundexperts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

9 participants