App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-09-07] [$250] Taxes - Name field is no longer grayed out after editing tax code offline

Open IuliiaHerets opened this issue 1 year ago • 19 comments

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: v9.0.22-5 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Exp https://expensify.testrail.io/index.php?/tests/view/4874241 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Taxes.
  3. Go offline.
  4. Click on any tax rate.
  5. Click Name.
  6. Edit the name and save it.
  7. Click Tax code.
  8. Edit Tax code and save it.

Expected Result:

Name field will remain grayed out after editing tax code offline.

Actual Result:

Name field is no longer grayed out after editing tax code offline.

Workaround:

Unknown

Platforms:

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [x] iOS: Native
  • [x] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/096e04a3-79a3-46e9-9c65-a91e1e7cf762

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01da26942e57c47d6b
  • Upwork Job ID: 1826075814524858613
  • Last Price Increase: 2024-08-21
Issue OwnerCurrent Issue Owner: @kadiealexander

IuliiaHerets avatar Aug 20 '24 20:08 IuliiaHerets

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

melvin-bot[bot] avatar Aug 20 '24 20:08 melvin-bot[bot]

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

IuliiaHerets avatar Aug 20 '24 20:08 IuliiaHerets

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

IuliiaHerets avatar Aug 20 '24 20:08 IuliiaHerets

Edited by proposal-police: This proposal was edited at 2024-08-20 20:40:06 UTC.

Proposal

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

Taxes - Name field is no longer grayed out after editing tax code offline

What is the root cause of that problem?

Current pending field are not spread when updating the tax code. When updating tax code we create a key/value pair with the new tax code name so the pending fields are not merged in this case like it does when updating name or value, that's why we don't need to spread the pending fields when updating name or value.

https://github.com/Expensify/App/blob/b2eb922823d491996faa5d50275bfce540e9b288/src/libs/actions/TaxRate.ts#L498-L503

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

Spread the pending fields. We should also check for other update actions for tax details edit.

EDIT: We don't need to do that when editing name or value.

What alternative solutions did you explore? (Optional)



Result

https://github.com/user-attachments/assets/c75a04de-8dea-43d1-997b-9858f86ee627

Krishna2323 avatar Aug 20 '24 20:08 Krishna2323

Edited by proposal-police: This proposal was edited at 2024-08-20 21:06:07 UTC.

Proposal

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

Taxes - Name field is no longer grayed out after editing tax code offline

What is the root cause of that problem?

when updating the tax code it overrides the existing pending fields: https://github.com/Expensify/App/blob/b2eb922823d491996faa5d50275bfce540e9b288/src/libs/actions/TaxRate.ts#L496C21-L525C27

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

we should add the existing pending field from the originalTaxRate.pendingFields into the pending fields object... same applies to the success and the failure data

To do that we should change the pending fields property in the optimistic values to:

pendingFields: {...(originalTaxRate?.pendingFields ?? {}), code: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE},

also, modify that in the success and failure objects

What alternative solutions did you explore? (Optional)

N.A

abzokhattab avatar Aug 20 '24 20:08 abzokhattab

Proposal Updated

  • Added result video.

Krishna2323 avatar Aug 20 '24 20:08 Krishna2323

Proposal Updated

  • Updated RCA to include a better explanation, the solution remains the same.

Krishna2323 avatar Aug 20 '24 20:08 Krishna2323

Proposal Updated

Added the code implementation

abzokhattab avatar Aug 20 '24 21:08 abzokhattab

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

melvin-bot[bot] avatar Aug 21 '24 01:08 melvin-bot[bot]

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

melvin-bot[bot] avatar Aug 21 '24 01:08 melvin-bot[bot]

@Krishna2323 's first posted proposal comment shows the offending code block correctly in the RCA and the suggested solution is clear enough. I think we can proceed with his proposal because his is first.

🎀 👀 🎀 C+ Reviewed

c3024 avatar Aug 21 '24 04:08 c3024

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

melvin-bot[bot] avatar Aug 21 '24 04:08 melvin-bot[bot]

@mountiny, bump for assignment if you agree with @c3024's decision.

Krishna2323 avatar Aug 23 '24 19:08 Krishna2323

Go ahead please @Krishna2323

mountiny avatar Aug 23 '24 20:08 mountiny

@c3024, PR ready for review ^

Krishna2323 avatar Aug 23 '24 21:08 Krishna2323

Automation failed here. This was deployed to production yesterday. Payment due on 7-Sep or 8-Sep.

cc: @kadiealexander

c3024 avatar Aug 31 '24 13:08 c3024

Updated

$250 to @Krishna2323 and to @c3024

mountiny avatar Sep 02 '24 10:09 mountiny

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:

  • [x] [@c3024] The PR that introduced the bug has been identified. Link to the PR: #43156
  • [x] [@c3024] 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: https://github.com/Expensify/App/commit/bee9d44584a82ad6efa1b689f1aac65b9884b387#r146398000
  • [x] [@c3024] 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: No discussion was started because this could not have identified earlier.
  • [x] [@c3024] Determine if we should create a regression test for this bug.
  • [x] [@c3024] 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.
  • [x] [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/426788

kadiealexander avatar Sep 04 '24 22:09 kadiealexander

Payment Summary

Upwork Job

  • Contributor: @Krishna2323 paid $250 via Upwork (https://www.upwork.com/nx/wm/offer/103873834)
  • Reviewer: @c3024 paid $250 via Upwork (https://www.upwork.com/offer/103873822)

BugZero Checklist (@kadiealexander)

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

melvin-bot[bot] avatar Sep 07 '24 17:09 melvin-bot[bot]

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:

  • [x] [@c3024] The PR that introduced the bug has been identified. Link to the PR: #43156
  • [x] [@c3024] 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: https://github.com/Expensify/App/commit/bee9d44584a82ad6efa1b689f1aac65b9884b387#r146398000
  • [x] [@c3024] 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: No discussion was started because this could not have identified earlier.
  • [x] [@c3024] Determine if we should create a regression test for this bug. Yes
  • [x] [@c3024] 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

  1. Go to workspace settings > Taxes.
  2. Go offline.
  3. Click on any tax rate.
  4. Click on Name.
  5. Edit the name and save it.
  6. Click on Tax code.
  7. Edit the Tax code and save it.
  8. Verify that the name field remains greyed out.

c3024 avatar Sep 08 '24 14:09 c3024

Not overdue, offers sent!

kadiealexander avatar Sep 09 '24 01:09 kadiealexander

Offer accepted.

Krishna2323 avatar Sep 09 '24 03:09 Krishna2323