Skip to content

[$250] Tax code - Error shows up when attempting to save tax code without modifying it #45770

Closed

Description

@lanitochka17

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: 9.0.9-1
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:

  • Workspace is under Control plan
  1. Go to staging.new.expensify.com
  2. Go to Workspace settings > Taxes
  3. Click on any tax
  4. Click Tax code
  5. Without modifying the existing tax code, save the tax code

Expected Result:

User will be able to save existing tax code when no changes are made

Actual Result:

Error shows up when attempting to save tax code without modifying it - This tax code is already in use

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

Bug6547141_1721391649811.20240719_201838.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0100ee19e52f8bb5b6
  • Upwork Job ID: 1814285898085752540
  • Last Price Increase: 2024-07-19
Issue OwnerCurrent Issue Owner: @rayane-djouah

Activity

  1. added
    DeployBlockerCash
    DeployBlocker
    on Jul 19, 2024
  2. melvin-bot commented on Jul 19, 2024

    @melvin-bot

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

  3. github-actions commented on Jul 19, 2024

    @github-actions
    Contributor

    👋 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.
  4. etCoderDysto commented on Jul 19, 2024

    @etCoderDysto
    Contributor

    Proposal

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

    Error shows up when attempting to save tax code without modifying it

    What is the root cause of that problem?

    On submit, we call validateTaxCode passing current input value and policy as params. And validateTaxCode, compares current value with existing tax code keys and returns error when finding a matching key in policy.taxRates.taxes

    const validate = useCallback(
    (values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_TAX_CODE_FORM>) => {
    if (!policy) {
    return {};
    }
    return validateTaxCode(policy, values);

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

    We should check if the input value is equal to the currentTaxCode tax code. Then return empty object if they are equal before returning result of validateTaxCode(policy, values);

    if (values?.taxCode.trim() === currentTaxCode) return {};
    return validateTaxCode(policy, values);

    What alternative solutions did you explore? (Optional)

  5. trjExpensify commented on Jul 19, 2024

    @trjExpensify
    Contributor
  6. added
    External
    and removed
    DeployBlocker
    on Jul 19, 2024
  7. melvin-bot commented on Jul 19, 2024

    @melvin-bot
  8. changed the title [-]Tax code - Error shows up when attempting to save tax code without modifying it[/-] [+][$250] Tax code - Error shows up when attempting to save tax code without modifying it[/+] on Jul 19, 2024
  9. added
    Help Wanted
    on Jul 19, 2024
  10. 17 remaining items

  11. rushatgabhane commented on Jul 22, 2024

    @rushatgabhane
    Member

    How are we looking on the fix for this

    @dangrous fixing it in PR - #45866 because it was a one liner

  12. dangrous commented on Jul 23, 2024

    @dangrous
    Contributor

    oh okay great! ping me as a reviewer when it's ready if you could - thanks!

  13. added
    Reviewing
    on Jul 26, 2024
  14. melvin-bot commented on Aug 2, 2024

    @melvin-bot

    @dangrous, @mollfpr, @rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!

  15. dangrous commented on Aug 2, 2024

    @dangrous
    Contributor

    not overdue, solution has been deployed to prod. Didn't get the automation because the issue link didn't have $. I added it so hopefully we'll get it, but if not - payment due 8/9 i believe!

  16. dangrous commented on Aug 12, 2024

    @dangrous
    Contributor

    This one is all set in terms of timeline. Are we treating this as a regression, @rushatgabhane / @mollfpr ? Or do we need to grab a BZ for payment?

  17. rushatgabhane commented on Aug 12, 2024

    @rushatgabhane
    Member

    this would be a regression @dangrous

  18. dangrous commented on Aug 12, 2024

    @dangrous
    Contributor

    okay cool i will go ahead and close then, if you need anything else let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

DailyEngineeringExternalReviewing

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions