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-05-09] [$250] Taxes - Tax exceeding limit is saved instead of showing error in tax input editor #41075

Closed
6 tasks done
izarutskaya opened this issue Apr 26, 2024 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Apr 26, 2024

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

Action Performed:

Precondition:

  • Collect workspace has enabled tax.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Go to + > Submit expense > Manual.
  4. Click 'Show more' at bottom to show tax enabling option.
  5. Select a non-zero tax rate.
  6. Click Tax amount in confirmation page.
  7. Enter amount exceeding the limit.
  8. Note that error shows up in the tax input editor.
  9. Click back arrow at top.
  10. Create the expense.
  11. Go to transaction thread.
  12. Click Tax amount.
  13. Enter amount exceeding the limit and save it.

Expected Result:

Error will show up in the tax input editor.

Actual Result:

The exceeding tax amount is saved, and error shows up in transaction thread.

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

Bug6462414_1714107729920.bandicam_2024-04-26_12-53-58-099.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010c9f037136424e8d
  • Upwork Job ID: 1783999186300325889
  • Last Price Increase: 2024-04-26
  • Automatic offers:
    • Ollyws | Reviewer | 0
    • Krishna2323 | Contributor | 0
Issue OwnerCurrent Issue Owner: @Ollyws
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 26, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

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

@izarutskaya
Copy link
Author

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

@Krishna2323
Copy link
Contributor

Proposal

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

Taxes - Tax exceeding limit is saved instead of showing error in tax input editor

What is the root cause of that problem?

On initial render the value from Navigation.getActiveRoute() doesn't include the correct url and due to this the isTaxAmountInvalid always returns false.

const isTaxAmountForm = Navigation.getActiveRoute().includes('taxAmount');

const isTaxAmountInvalid = (currentAmount: string, taxAmount: number, isTaxAmountForm: boolean) =>
isTaxAmountForm && Number.parseFloat(currentAmount) > CurrencyUtils.convertToFrontendAmount(Math.abs(taxAmount));

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

We can define isTaxAmountForm inside submitAndNavigateToNextPage. This will ensure that we always get the latest value from Navigation.getActiveRoute() when form is submitted.

const submitAndNavigateToNextPage = useCallback(

What alternative solutions did you explore? (Optional)

Remove isTaxAmountForm check.

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 26, 2024
@melvin-bot melvin-bot bot changed the title Taxes - Tax exceeding limit is saved instead of showing error in tax input editor [$250] Taxes - Tax exceeding limit is saved instead of showing error in tax input editor Apr 26, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

Job added to Upwork: https://www.upwork.com/jobs/~010c9f037136424e8d

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 26, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

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

@mallenexpensify
Copy link
Contributor

Updated steps in OP for clarity. Was able to reproduce.
@Ollyws please review the proposal above.
Added to #wave-collect.

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2024
@Ollyws
Copy link
Contributor

Ollyws commented Apr 29, 2024

Reviewing today.

@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2024
@Ollyws
Copy link
Contributor

Ollyws commented Apr 29, 2024

@Krishna2323's proposal LGTM!
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Apr 29, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

📣 @Ollyws 🎉 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

Copy link

melvin-bot bot commented Apr 29, 2024

📣 @Krishna2323 🎉 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 📖

@Krishna2323
Copy link
Contributor

@Ollyws, PR ready for review.

Copy link

melvin-bot bot commented May 1, 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 May 2, 2024
@melvin-bot melvin-bot bot changed the title [$250] Taxes - Tax exceeding limit is saved instead of showing error in tax input editor [HOLD for payment 2024-05-09] [$250] Taxes - Tax exceeding limit is saved instead of showing error in tax input editor May 2, 2024
Copy link

melvin-bot bot commented May 2, 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 May 2, 2024
Copy link

melvin-bot bot commented May 2, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.69-2 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-05-09. 🎊

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

Copy link

melvin-bot bot commented May 2, 2024

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:

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels May 8, 2024
@mallenexpensify
Copy link
Contributor

mallenexpensify commented May 9, 2024

Contributor: @Krishna2323 paid $250 via Upwork
Contributor+: @Ollyws paid $250 via Upwork

@Ollyws can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~010c9f037136424e8d

Can you please fill out the BZ checklist too? Thx

@melvin-bot melvin-bot bot removed the Overdue label May 9, 2024
@Ollyws
Copy link
Contributor

Ollyws commented May 10, 2024

Offer accepted, just trying to track down which PR caused this. @Krishna2323 if you have any idea it would be much appreciated.

@Krishna2323
Copy link
Contributor

@Ollyws PR which added isTaxAmountForm constant.

@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

@cead22, @Ollyws, @mallenexpensify, @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mallenexpensify
Copy link
Contributor

@Ollyws paid, payment comment updated above.
Thanks @Krishna2323 for the PR link. Can you post the BZ checklist when you have a min @Ollyws

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2024
@Ollyws
Copy link
Contributor

Ollyws commented May 17, 2024

@Ollyws #32550 which added isTaxAmountForm constant.

Hmm but that PR was created before the ability to edit the tax amount in the transaction view was added. I'm going to leave it off for now so we can close this.

@Ollyws
Copy link
Contributor

Ollyws commented May 17, 2024

BugZero Checklist:

  • Determine if we should create a regression test for this bug.
  • 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.

Regression Test Proposal

Precondition: Collect workspace has enabled tax.

1. Go to workspace chat.
2. Go to + > Submit expense > Manual.
3. Click 'Show more' at bottom to show tax enabling option.
4. Select a non-zero tax rate.
5. Click Tax amount in confirmation page.
6. Enter amount exceeding the limit.
7. Note that error shows up in the tax input editor.
8. Click back arrow at top.
9. Create the expense.
10. Go to transaction thread.
11. Click Tax amount.
12. Enter amount exceeding the limit and save it.
13. Verify that error shows up in the tax input editor.

Do we agree 👍 or 👎

@mallenexpensify
Copy link
Contributor

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants