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-06-11] [$250] Taxes - App allows deleted tax rate to be selected as currency default in offline mode #41066

Closed
6 tasks done
izarutskaya opened this issue Apr 26, 2024 · 45 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 contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.66-1
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:

  • Workspace and Foreign currency default share the same tax rate.
  • There are Tax rate A and B.
  1. Go to staging.new.expensify.com
  2. Go to Account settings > Workspaces > any workspace.
  3. Go to Taxes.
  4. Go offline.
  5. Delete one of the tax rate which is not the default tax rate.
  6. Go to Settings > Workspace currency default.
  7. Select the deleted tax rate.
  8. Now delete the remaining tax rate.

Expected Result:

In Step 7, user should not be able to select the deleted tax rate.

Actual Result:

In Step 7, user is able to select the deleted tax rate, which results in all the tax rate being able to be deleted.

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

Bug6462146_1714080991768.20240426_052954.mp4

View all open jobs on GitHub

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

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

Copy link

melvin-bot bot commented Apr 26, 2024

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Apr 26, 2024

Proposal

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

Taxes - App allows deleted tax rate to be selected as currency default in offline mode

What is the root cause of that problem?

We don't have any logic to exclude the deleted options or to disable the option when deleted offline.

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

We can solve the issue in 2 ways.

  1. Exclude the deleted option from the list.
    const enabledTaxRates = sortedTaxRates.filter((taxRate) => !taxRate.isDisabled);

    Update to:
const enabledTaxRates = sortedTaxRates.filter((taxRate) => !taxRate.isDisabled && !(taxRate.pendingAction === 'delete'));
  1. Return the pending action pendingAction: taxRate.pendingAction from getTaxRatesOptions. Then update the BaseListItem to use item.pendingAction as optional pendingAction value (pendingAction={pendingAction || item.pendingAction}). Also we need to update the disabled in BaseListItem to disable the option when pending action is delete (disabled={isDisabled || item.pendingAction===CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE}).

Note: There might be similar pages with similar functionality, we need to check for that also. Also, we might not need to make changes when pending action is update/add, that can be excluded.

What alternative solutions did you explore? (Optional)

We can directly disable the option in getTaxRatesOptions by updating the isDisabled property to isDisabled: taxRate.isDisabled || taxRate.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE.

  1. We need to return pendingAction for options, from util functions like getCategoryListSections.
  2. In getCategoryOptionTree we will set disabled as true if option.pendingAction === 'delete'.
  3. In RadioListItem, we need to pass pendingAction={item.pendingAction} to BaseListItem.

Alternative solutions 2

  • Return the pending action pendingAction: taxRate.pendingAction from getTaxRatesOptions.
  • In renderItem function update the isDisabled value to also check for item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE and pass the pending action pendingAction={item.pendingAction}.
  • Accept pendingAction in RadioListItem and then pass it to BaseListItem.

@Krishna2323
Copy link
Contributor

Proposal Updated

  • Added note.

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

melvin-bot bot commented Apr 29, 2024

@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@JmillsExpensify
Copy link

Adding as polish for wave-collect and opening up to the community.

@melvin-bot melvin-bot bot removed the Overdue label May 1, 2024
@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label May 1, 2024
@melvin-bot melvin-bot bot changed the title Taxes - App allows deleted tax rate to be selected as currency default in offline mode [$250] Taxes - App allows deleted tax rate to be selected as currency default in offline mode May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0120c22699693bf475

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

melvin-bot bot commented May 1, 2024

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

@sobitneupane
Copy link
Contributor

Thanks for the proposal @Krishna2323

I tested Categories and the issue is reproducible. I am pretty sure the issue lies in other similar functionality as well.

@JmillsExpensify Should we completely hide the deleted tax, or simply disable it in the list?

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

melvin-bot bot commented May 7, 2024

@JmillsExpensify, @sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented May 8, 2024

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

Copy link

melvin-bot bot commented May 8, 2024

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

@sobitneupane
Copy link
Contributor

@JmillsExpensify Any thoughts on #41066 (comment)?

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

melvin-bot bot commented May 10, 2024

@JmillsExpensify @sobitneupane 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!

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

melvin-bot bot commented May 14, 2024

@JmillsExpensify, @sobitneupane Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

Good question. I tend to think that we should hide it in those other lists shown in the OP, especially given that we already use the pending pattern where the actual deletion occurred. cc @trjExpensify in case you disagree.

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

melvin-bot bot commented May 15, 2024

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

Copy link

melvin-bot bot commented May 31, 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 Jun 4, 2024
@melvin-bot melvin-bot bot changed the title [$250] Taxes - App allows deleted tax rate to be selected as currency default in offline mode [HOLD for payment 2024-06-11] [$250] Taxes - App allows deleted tax rate to be selected as currency default in offline mode Jun 4, 2024
Copy link

melvin-bot bot commented Jun 4, 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 Jun 4, 2024
Copy link

melvin-bot bot commented Jun 4, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.78-5 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-06-11. 🎊

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

Copy link

melvin-bot bot commented Jun 4, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane] 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:
  • [@sobitneupane] 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:
  • [@sobitneupane] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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.
  • [@JmillsExpensify] 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 Jun 10, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

@JmillsExpensify, @Beamanator, @sobitneupane, @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@Krishna2323
Copy link
Contributor

@JmillsExpensify, bump for payments.

Copy link

melvin-bot bot commented Jun 17, 2024

@JmillsExpensify, @Beamanator, @sobitneupane, @Krishna2323 Still overdue 6 days?! Let's take care of this!

@JmillsExpensify
Copy link

@sobitneupane mind filling out the BZ checklist? In the meantime, payment summary as follows:

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2024
@JmillsExpensify
Copy link

Contributor paid out and C+ is paid through New Expensify, so I'm going to close this issue and we can circle back on checklist during payment approvals.

@sobitneupane
Copy link
Contributor

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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

The issue was already present in Section List. It was resurfaced in the app with the introduction of fields like Category, Tag and Tax fields

@sobitneupane
Copy link
Contributor

Regression Test Proposal:

  1. Go to Account settings > Workspaces > any workspace.
  2. Go to Taxes.
  3. Go offline.
  4. Delete one of the tax rate which is not the default tax rate.
  5. Go to Settings > Workspace currency default.
  6. Verify deleted tax rate can't be selected and is styled correctly with strike-through

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jun 21, 2024
@JmillsExpensify
Copy link

Need someone else to confirm my payment summary. I've added the regression test in the meantime.

@melvin-bot melvin-bot bot removed the Overdue label Jun 22, 2024
@mallenexpensify
Copy link
Contributor

Contributor: $250 @Krishna2323 paid via Upwork
Contributor+: $250 @sobitneupane due via NewDot.

@JmillsExpensify
Copy link

$250 approved for @sobitneupane

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2024
@JmillsExpensify
Copy link

Everyone paid out and regression test created, so I'm closing this one.

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

7 participants