Skip to content

[HOLD Auth PR 20508] [$250] Expense - Tax violation message briefly shown and disappeared. #85810

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: V9.3.40
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod - Provide reasoning.
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #78472
Email or phone of affected tester (no customers): dreamnitethedragon+yydyd373@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Web
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Create workspace
  3. Enable tax
  4. Go to Workspace chat
  5. Create an expense entering merchant and select tax rate 1 - 5%
  6. Go to workspace settings
  7. Delete tax rate 1 - 5%
  8. Add a tax rate hj - 5%
  9. Go to workspace chat
  10. Note preview shows tax no longer valid
  11. Open the transaction thread and note tax no longer valid briefly shown and disappeared
  12. Open tax and note deleted tax is selected and greyed

Expected Result:

Deleted tax is selected and greyed so violation message must be shown and not disappeared.

Actual Result:

Deleted tax is selected and greyed but violation message briefly shown and disappeared.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7106274_1773842313262.bandicam_2026-03-18_19-18-36-511.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @c3024
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022034628906822029942
  • Upwork Job ID: 2034628906822029942
  • Last Price Increase: 2026-03-19

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 19, 2026
  2. MelvinBot commented on Mar 19, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When a tax rate used on an expense is deleted from workspace settings, the "Tax no longer valid" violation message appears briefly in the transaction thread and then disappears. The deleted tax remains selected and greyed out, but the violation message does not persist as expected.

    What is the root cause of that problem?

    The deletePolicyTaxes function (src/libs/actions/TaxRate.ts:285-411) only updates ONYXKEYS.COLLECTION.POLICY data — it does not recompute or update TRANSACTION_VIOLATIONS for any affected transactions.

    The violation computation logic lives in ViolationsUtils.getViolationsOnyxData() (src/libs/Violations/ViolationsUtils.ts:643-649), which checks whether the transaction's taxCode exists in policy.taxRates.taxes:

    const isTaxInPolicy = Object.keys(policy.taxRates?.taxes ?? {}).some((key) => key === updatedTransaction.taxCode);

    However, this function is only called imperatively during transaction edit operations (create, edit, move) — there is no reactive mechanism that re-runs violation computation when policy data changes.

    The "flash then disappear" behavior happens because:

    1. When opening the transaction thread, the OpenReport API call may return TRANSACTION_VIOLATIONS from the server that include the taxOutOfPolicy violation — causing it to briefly appear
    2. A subsequent server response or Pusher event overwrites the TRANSACTION_VIOLATIONS Onyx key with data that does not include this violation, causing it to disappear
    3. During the optimistic DELETE phase, the tax key still exists in the policy object (marked with pendingAction: DELETE), so any client-side recomputation would incorrectly find isTaxInPolicy === true and not add the violation

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

    In deletePolicyTaxes (src/libs/actions/TaxRate.ts), after computing the policy optimistic/success/failure data, we should also find all transactions whose taxCode matches any of the deleted tax IDs and add optimistic TRANSACTION_VIOLATIONS updates that include the taxOutOfPolicy violation. This is similar to how other actions like changeTransactionsReport in Transaction.ts call ViolationsUtils.getViolationsOnyxData() for affected transactions.

    Specifically:

    1. Query Onyx for all transactions that reference the deleted tax codes
    2. For each affected transaction, compute updated violations using ViolationsUtils.getViolationsOnyxData() (passing the policy with the tax already removed so isTaxInPolicy returns false)
    3. Add these violation updates to the optimistic/failure data arrays in the deletePolicyTaxes API call

    This ensures the taxOutOfPolicy violation is added immediately when the tax is deleted, rather than relying on the server to push it back asynchronously.

    What alternative solutions did you explore? (Optional)

    An alternative would be to introduce a reactive Onyx listener that watches for changes to policy.taxRates.taxes and re-runs getViolationsOnyxData for all transactions in the workspace. However, this would be a larger architectural change and could have performance implications. The targeted approach of updating violations within deletePolicyTaxes is more consistent with existing patterns in the codebase.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2026
  5. melvin-bot commented on Mar 19, 2026

    @melvin-bot

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

  6. changed the title [-]Expense - Tax violation message briefly shown and disappeared.[/-] [+][$250] Expense - Tax violation message briefly shown and disappeared.[/+] on Mar 19, 2026
  7. melvin-bot commented on Mar 19, 2026

    @melvin-bot
  8. kgshriramm commented on Mar 19, 2026

    @kgshriramm

    Proposal

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

    When a tax rate used by an expense is deleted from workspace settings, the transaction still shows that deleted tax selected (greyed out), but the Tax no longer valid violation appears briefly and then disappears.
    The violation should stay visible until the user selects a valid tax.

    What is the root cause of that problem?

    Tax validity is currently treated as “tax code key exists in policy,” but that is not enough during delete flow.

    In src/libs/Violations/ViolationsUtils.ts, tax checks consider a tax valid even when it is:

    pendingAction: DELETE, or
    isDisabled: true.

    Because of that, later violation recomputation incorrectly clears taxOutOfPolicy, causing the flash/disappear behavior.

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

    Update tax validity logic in src/libs/Violations/ViolationsUtils.ts so a tax is considered valid only if it is active.

    Specifically:

    1. In getViolationsOnyxData(...), replace key-existence-only tax check with an active-tax check:
      tax entry exists
      not disabled
      not pending delete
    [`${CONST.VIOLATIONS_PREFIX}${CONST.VIOLATIONS.TAX_OUT_OF_POLICY}`]: () => {
        if (!taxCode || !policyTaxRates) {
            return !taxCode;
        }
    
        const matchingTaxRate = policyTaxRates[taxCode];
        const isActiveTax =
            !!matchingTaxRate &&
            !matchingTaxRate.isDisabled &&
            matchingTaxRate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
    
        if (!isActiveTax) {
            return false;
        }
    
        // If taxValue is provided, require value match. Otherwise active tax code is enough.
        return taxValue !== undefined ? matchingTaxRate.value === taxValue : true;
    },
    1. In getIsViolationFixed(...) for taxOutOfPolicy, apply the same active-tax criteria before deciding the violation is fixed.
    const selectedTaxRate = updatedTransaction.taxCode ? policy.taxRates?.taxes?.[updatedTransaction.taxCode] : undefined;
    const isTaxInPolicy =
        !!selectedTaxRate &&
        !selectedTaxRate.isDisabled &&
        selectedTaxRate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

    This is the key optimal fix because it keeps taxOutOfPolicy when the selected tax is deleted/being deleted, including IOU flows that already use ViolationsUtils.getViolationsOnyxData(...).

    What alternative solutions did you explore? (Optional)

    1. Recomputing violations for all affected transactions inside deletePolicyTaxes.
      I did not choose this as the primary fix because it is broader and heavier.
    2. Adding UI-only persistence for the violation message.
      I did not choose this because it masks stale logic instead of fixing the source-of-truth validation.
  9. abbasifaizan70 commented on Mar 19, 2026

    @abbasifaizan70
    Contributor

    Proposal

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

    When a workspace tax rate used by an expense is deleted and a new tax rate is added, the expense preview in the workspace chat correctly shows "Tax no longer valid". However, upon opening the transaction thread, the violation message briefly appears and then disappears. The deleted tax is still shown as selected and greyed out in the tax field, but the violation message does not persist.

    Expected: The "Tax no longer valid" violation message persists in the transaction thread since the deleted tax is still selected.
    Actual: The violation message briefly flashes and disappears in the transaction thread.

    What is the root cause of that problem?

    When a tax rate is deleted via deletePolicyTaxes, the function does not call pushTransactionViolationsOnyxData to optimistically recalculate the TAX_OUT_OF_POLICY violation for affected transactions. This is inconsistent with how category and tag deletions are handled — both call pushTransactionViolationsOnyxData to ensure violations are computed immediately.

    function deletePolicyTaxes(policy: OnyxEntry<Policy>, taxesToDelete: string[], localeCompare: LocaleContextProps['localeCompare']) {
    const policyTaxRates = policy?.taxRates?.taxes;
    const foreignTaxDefault = policy?.taxRates?.foreignTaxDefault;
    const firstTaxID = Object.keys(policyTaxRates ?? {})
    .sort((a, b) => localeCompare(a, b))
    .at(0);
    const distanceRateCustomUnit = getDistanceRateCustomUnit(policy);
    const customUnitID = distanceRateCustomUnit?.customUnitID;
    const ratesToUpdate = Object.values(distanceRateCustomUnit?.rates ?? {}).filter(
    (rate) => !!rate.attributes?.taxRateExternalID && taxesToDelete.includes(rate.attributes?.taxRateExternalID),
    );
    if (!policyTaxRates) {
    console.debug('Policy or tax rates not found');
    return;
    }
    const isForeignTaxRemoved = foreignTaxDefault && taxesToDelete.includes(foreignTaxDefault);
    const optimisticRates: Record<string, NullishDeep<Rate>> = {};
    const successRates: Record<string, NullishDeep<Rate>> = {};
    const failureRates: Record<string, NullishDeep<Rate>> = {};
    for (const rate of ratesToUpdate) {
    const rateID = rate.customUnitRateID;
    optimisticRates[rateID] = {
    attributes: {
    taxRateExternalID: null,
    taxClaimablePercentage: null,
    },
    pendingFields: {
    taxRateExternalID: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    taxClaimablePercentage: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    },
    };
    successRates[rateID] = {pendingFields: {taxRateExternalID: null, taxClaimablePercentage: null}};
    failureRates[rateID] = {
    attributes: {...rate?.attributes},
    pendingFields: {taxRateExternalID: null, taxClaimablePercentage: null},
    errorFields: {
    taxRateExternalID: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'),
    taxClaimablePercentage: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'),
    },
    };
    }
    const onyxData: OnyxData<typeof ONYXKEYS.COLLECTION.POLICY> = {
    optimisticData: [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`,
    value: {
    taxRates: {
    pendingFields: {foreignTaxDefault: isForeignTaxRemoved ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : null},
    foreignTaxDefault: isForeignTaxRemoved ? firstTaxID : foreignTaxDefault,
    taxes: taxesToDelete.reduce<TaxRateDeleteMap>((acc, taxID) => {
    acc[taxID] = {pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, errors: null, isDisabled: true};
    return acc;
    }, {}),
    },
    // @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
    customUnits: distanceRateCustomUnit &&
    customUnitID && {
    [customUnitID]: {
    rates: optimisticRates,
    },
    },
    },
    },
    ],
    successData: [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`,
    value: {
    taxRates: {
    pendingFields: {foreignTaxDefault: null},
    taxes: taxesToDelete.reduce<TaxRateDeleteMap>((acc, taxID) => {
    acc[taxID] = null;
    return acc;
    }, {}),
    },
    // @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
    customUnits: distanceRateCustomUnit &&
    customUnitID && {
    [customUnitID]: {
    rates: successRates,
    },
    },
    },
    },
    ],
    failureData: [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`,
    value: {
    taxRates: {
    pendingFields: {foreignTaxDefault: null},
    taxes: taxesToDelete.reduce<TaxRateDeleteMap>((acc, taxID) => {
    acc[taxID] = {
    pendingAction: null,
    errors: getMicroSecondOnyxErrorWithTranslationKey('workspace.taxes.error.deleteFailureMessage'),
    isDisabled: !!policyTaxRates?.[taxID]?.isDisabled,
    };
    return acc;
    }, {}),
    },
    // @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
    customUnits: distanceRateCustomUnit &&
    customUnitID && {
    [customUnitID]: {
    rates: failureRates,
    },
    },
    },
    },
    ],
    };
    const parameters = {
    policyID: policy.id,
    taxNames: JSON.stringify(taxesToDelete.map((taxID) => policyTaxRates[taxID].name)),
    } satisfies DeletePolicyTaxesParams;
    API.write(WRITE_COMMANDS.DELETE_POLICY_TAXES, parameters, onyxData);
    }

    For comparison, deletePolicyTags does call pushTransactionViolationsOnyxData:

    pushTransactionViolationsOnyxData(onyxData, policyData, {}, {}, policyTagsOptimisticData);

    And setWorkspaceCategoryEnabled / category delete functions also call it:

    pushTransactionViolationsOnyxData(onyxData, policyData, {}, policyCategoriesOptimisticData);

    The TAX_OUT_OF_POLICY violation is computed client-side inside getViolationsOnyxData by checking whether the transaction's taxCode still exists in policy.taxRates.taxes:

    const isTaxInPolicy = Object.keys(policy.taxRates?.taxes ?? {}).some((key) => key === updatedTransaction.taxCode);

    if (isPolicyTrackTaxEnabled && !hasTaxOutOfPolicyViolation && !isTaxInPolicy) {
    newTransactionViolations.push({name: CONST.VIOLATIONS.TAX_OUT_OF_POLICY, type: CONST.VIOLATION_TYPES.VIOLATION, showInReview: true});
    }
    if (isPolicyTrackTaxEnabled && hasTaxOutOfPolicyViolation && isTaxInPolicy) {
    newTransactionViolations = reject(newTransactionViolations, {name: CONST.VIOLATIONS.TAX_OUT_OF_POLICY});
    }

    Without the optimistic violation recalculation during tax deletion, the violation only arrives from the server response. When the transaction thread is subsequently opened, the OpenReport server response can overwrite the local violation data, causing the briefly-visible violation to disappear.

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

    Call pushTransactionViolationsOnyxData inside deletePolicyTaxes — the same pattern already used by category and tag operations — so that TAX_OUT_OF_POLICY violations are computed optimistically at delete time.

    This requires three changes:

    1. src/libs/actions/TaxRate.ts — Update deletePolicyTaxes to accept PolicyData (instead of just Policy) and call pushTransactionViolationsOnyxData with an optimistic policy that has the deleted taxes filtered out.

    function deletePolicyTaxes(policy: OnyxEntry<Policy>, taxesToDelete: string[], localeCompare: LocaleContextProps['localeCompare']) {
    const policyTaxRates = policy?.taxRates?.taxes;
    const foreignTaxDefault = policy?.taxRates?.foreignTaxDefault;
    const firstTaxID = Object.keys(policyTaxRates ?? {})
    .sort((a, b) => localeCompare(a, b))
    .at(0);
    const distanceRateCustomUnit = getDistanceRateCustomUnit(policy);
    const customUnitID = distanceRateCustomUnit?.customUnitID;
    const ratesToUpdate = Object.values(distanceRateCustomUnit?.rates ?? {}).filter(
    (rate) => !!rate.attributes?.taxRateExternalID && taxesToDelete.includes(rate.attributes?.taxRateExternalID),
    );
    if (!policyTaxRates) {
    console.debug('Policy or tax rates not found');
    return;
    }
    const isForeignTaxRemoved = foreignTaxDefault && taxesToDelete.includes(foreignTaxDefault);
    const optimisticRates: Record<string, NullishDeep<Rate>> = {};
    const successRates: Record<string, NullishDeep<Rate>> = {};
    const failureRates: Record<string, NullishDeep<Rate>> = {};
    for (const rate of ratesToUpdate) {
    const rateID = rate.customUnitRateID;
    optimisticRates[rateID] = {
    attributes: {
    taxRateExternalID: null,
    taxClaimablePercentage: null,
    },
    pendingFields: {
    taxRateExternalID: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    taxClaimablePercentage: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    },
    };
    successRates[rateID] = {pendingFields: {taxRateExternalID: null, taxClaimablePercentage: null}};
    failureRates[rateID] = {
    attributes: {...rate?.attributes},
    pendingFields: {taxRateExternalID: null, taxClaimablePercentage: null},
    errorFields: {
    taxRateExternalID: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'),
    taxClaimablePercentage: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'),
    },
    };
    }
    const onyxData: OnyxData<typeof ONYXKEYS.COLLECTION.POLICY> = {
    optimisticData: [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`,
    value: {
    taxRates: {
    pendingFields: {foreignTaxDefault: isForeignTaxRemoved ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : null},
    foreignTaxDefault: isForeignTaxRemoved ? firstTaxID : foreignTaxDefault,
    taxes: taxesToDelete.reduce<TaxRateDeleteMap>((acc, taxID) => {
    acc[taxID] = {pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, errors: null, isDisabled: true};
    return acc;
    }, {}),
    },
    // @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
    customUnits: distanceRateCustomUnit &&
    customUnitID && {
    [customUnitID]: {
    rates: optimisticRates,
    },
    },
    },
    },
    ],
    successData: [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`,
    value: {
    taxRates: {
    pendingFields: {foreignTaxDefault: null},
    taxes: taxesToDelete.reduce<TaxRateDeleteMap>((acc, taxID) => {
    acc[taxID] = null;
    return acc;
    }, {}),
    },
    // @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
    customUnits: distanceRateCustomUnit &&
    customUnitID && {
    [customUnitID]: {
    rates: successRates,
    },
    },
    },
    },
    ],
    failureData: [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`,
    value: {
    taxRates: {
    pendingFields: {foreignTaxDefault: null},
    taxes: taxesToDelete.reduce<TaxRateDeleteMap>((acc, taxID) => {
    acc[taxID] = {
    pendingAction: null,
    errors: getMicroSecondOnyxErrorWithTranslationKey('workspace.taxes.error.deleteFailureMessage'),
    isDisabled: !!policyTaxRates?.[taxID]?.isDisabled,
    };
    return acc;
    }, {}),
    },
    // @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
    customUnits: distanceRateCustomUnit &&
    customUnitID && {
    [customUnitID]: {
    rates: failureRates,
    },
    },
    },
    },
    ],
    };
    const parameters = {
    policyID: policy.id,
    taxNames: JSON.stringify(taxesToDelete.map((taxID) => policyTaxRates[taxID].name)),
    } satisfies DeletePolicyTaxesParams;
    API.write(WRITE_COMMANDS.DELETE_POLICY_TAXES, parameters, onyxData);
    }

    import type PolicyData from '@hooks/usePolicyData/types';
    import {pushTransactionViolationsOnyxData} from '@libs/ReportUtils';
    
    function deletePolicyTaxes(policyData: PolicyData, taxesToDelete: string[], localeCompare: LocaleContextProps['localeCompare']) {
        const policy = policyData.policy;
        const policyTaxRates = policy?.taxRates?.taxes;
        // ... existing logic unchanged ...
    
        const onyxData: OnyxData<typeof ONYXKEYS.COLLECTION.POLICY | typeof ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS> = {
            // ... existing optimistic/success/failure data unchanged ...
        };
    
        const optimisticTaxes = Object.fromEntries(Object.entries(policyTaxRates).filter(([taxID]) => !taxesToDelete.includes(taxID)));
        pushTransactionViolationsOnyxData(onyxData, policyData, {
            taxRates: {
                ...policy?.taxRates,
                taxes: optimisticTaxes,
            },
        });
    
        const parameters = {
            policyID: policy.id,
            taxNames: JSON.stringify(taxesToDelete.map((taxID) => policyTaxRates[taxID].name)),
        } satisfies DeletePolicyTaxesParams;
    
        API.write(WRITE_COMMANDS.DELETE_POLICY_TAXES, parameters, onyxData);
    }

    2. src/pages/workspace/taxes/WorkspaceTaxesPage.tsx — Use usePolicyData hook and pass policyData to deletePolicyTaxes.

    const deleteTaxes = useCallback(() => {
    if (!policy?.id) {
    return;
    }
    deletePolicyTaxes(policy, selectedTaxesIDs, localeCompare);
    setIsDeleteModalVisible(false);
    // eslint-disable-next-line @typescript-eslint/no-deprecated
    InteractionManager.runAfterInteractions(() => {
    setSelectedTaxesIDs([]);
    });
    }, [policy, selectedTaxesIDs, localeCompare]);

    import usePolicyData from '@hooks/usePolicyData';
    
    // inside the component:
    const policyData = usePolicyData(policyID);
    
    const deleteTaxes = useCallback(() => {
        if (!policy?.id) {
            return;
        }
        deletePolicyTaxes(policyData, selectedTaxesIDs, localeCompare);
        setIsDeleteModalVisible(false);
        InteractionManager.runAfterInteractions(() => {
            setSelectedTaxesIDs([]);
        });
    }, [policy?.id, policyData, selectedTaxesIDs, localeCompare]);

    3. src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx — Same pattern, use usePolicyData and pass policyData.

    const deleteTaxRate = () => {
    if (!policyID) {
    return;
    }
    deletePolicyTaxes(policy, [taxID], localeCompare);
    setIsDeleteModalVisible(false);
    Navigation.goBack();
    };

    import usePolicyData from '@hooks/usePolicyData';
    
    // inside the component:
    const policyData = usePolicyData(policyID);
    
    const deleteTaxRate = () => {
        if (!policyID) {
            return;
        }
        deletePolicyTaxes(policyData, [taxID], localeCompare);
        setIsDeleteModalVisible(false);
        Navigation.goBack();
    };

    This ensures TAX_OUT_OF_POLICY is added to Onyx immediately when a tax is deleted, consistent with how TAG_OUT_OF_POLICY and CATEGORY_OUT_OF_POLICY violations are handled. The violation persists through any subsequent server syncs because the optimistic data is in place before the API call completes.

    Test Branch

    https://github.com/abbasifaizan70/Expensify/tree/85810

  10. bernhardoj commented on Mar 20, 2026

    @bernhardoj
    Contributor

    This is most likely a BE issue. The tax is indeed deleted and no longer available. Even if we create a new tax with the same value, the ID is different (the ID is based on the name).

    @Expensify/contributor-plus-backend

  11. self-assigned this
    on Mar 20, 2026
  12. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 20, 2026
  13. 46 remaining items

  14. c3024 commented on May 1, 2026

    @c3024
    Contributor

    Asked for a clarification on Slack.

  15. added and removed on May 1, 2026
  16. changed the title [-][$250] Expense - Tax violation message briefly shown and disappeared.[/-] [+][HOLD Auth PR 20508] [$250] Expense - Tax violation message briefly shown and disappeared.[/+] on May 1, 2026
  17. c3024 commented on May 22, 2026

    @c3024
    Contributor

    The Auth PR on which this is held has been deployed. Requested QA to retest.

  18. m-natarajan commented on May 22, 2026

    @m-natarajan

    Chrome / app 9.3.79-2
    Message disappeared
    Deleted tax rate not shown

    REC-20260522160757.mp4
  19. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @bernhardoj, @c3024 eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  20. melvin-bot commented on Aug 28, 2026

    @melvin-bot

    @bernhardoj, @c3024, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2Not a priority

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions