Skip to content

[Due for payment 2026-04-16] [Due for payment 2026-04-14] Distance - Tax rate and amount do not update after selecting distance rate on confirm page #87202

Closed

Description

@mitarachim

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.3.53-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #84136
Email or phone of affected tester (no customers): sjoinjojsodidsjodjso@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Enable Distance rates and Taxes.
  • Enable Track tax in Distance settings.
  • Create a distance rate with 5% tax rate and any reclaimable amount.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Click + > Track distance > Manual.
  4. Enter amount > Next.
  5. On confirm page, click Rate.
  6. Select the rate with with 5% tax rate and any reclaimable amount.
  7. Scroll down to tax rate and tax amount section.

Expected Result:

Tax rate and amount will update to the correct value.

Actual Result:

Tax rate shows 0% and tax amount shows 0.00 after selecting distance rate with 5% tax on confirm page.

It only shows the correct tax rate and amount after creating the expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7123249_1775525941670.6.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Apr 7, 2026
  2. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #84136

  3. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 7, 2026

    @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.
  5. OSBotify commented on Apr 7, 2026

    @OSBotify
    Contributor

    Investigation Summary. Classification: Frontend bug. Causing PR: #84136 (PR 84136) - Feat: Add distance rate to the distance expenses tracked in selfDM by @FitseTLT (High confidence). Recommendation: REVERT. The regression is directly introduced by PR 84136 in the distance rate step logic. Reverting this PR would restore the correct tax rate/amount display behavior on the confirmation page. Labels: DeployBlockerCash kept (frontend App regression). DeployBlocker removed (no backend fix needed). Evidence: The bug is staging-only (new feature not yet in production), and PR 84136 is in the StagingDeployCash checklist (merged 2026-04-06T18:28:53Z). melvin-bot assigned PR 84136 as the causing PR. Bug appears when selecting a distance rate with tax on confirm page: tax shows 0% and 0.00 until after expense is created. Verification: Affected files are src/pages/iou/request/step/IOURequestStepDistanceRate.tsx and src/components/MoneyRequestConfirmationList.tsx. PR 84136 modifies both files directly. Root Cause: In IOURequestStepDistanceRate.tsx line 84, shouldShowTax is computed using isTaxTrackingEnabled with policy from usePolicyForTransaction. For a track distance expense in selfDM, this policy is undefined at rate-selection time (expense is unreported/draft). With policy undefined, isTaxTrackingEnabled returns false, so the tax update block (setMoneyRequestTaxAmount, setMoneyRequestTaxRate, setMoneyRequestTaxValue) is skipped when the user selects a rate. The draft transaction retains 0% / $0.00 tax values and only gets corrected after submission.

  6. removed
    DeployBlockerIndicates it should block deploying the API
    on Apr 7, 2026
  7. MelvinBot commented on Apr 7, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    In IOURequestStepDistanceRate.tsx:84, shouldShowTax is computed as:

    isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported(currentTransaction), policy, isDistanceRequest)
    

    For self-DM track expenses, both isPolicyExpenseChat (false — self-DM is not a group policy report) and isExpenseUnreported(currentTransaction) (false — the draft transaction has the self-DM reportID) evaluate to false. This makes shouldShowTax = false, so when the user selects a new distance rate, the entire tax computation block at lines 159-170 is skipped — taxCode, taxAmount, and taxValue are never updated on the transaction.

    Meanwhile, MoneyRequestConfirmationList.tsx:389 correctly includes isTrackExpense in its own shouldShowTax check, so the tax fields are displayed on the confirm page but show stale values from the initial default rate (0% if no tax was configured on the original rate).

    A secondary factor is the shouldKeepCurrentTaxSelection guard at MoneyRequestConfirmationList.tsx:395 — it treats the stale tax code as a deliberate user selection and prevents the confirm page's useEffect from self-correcting when the rate changes.

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

    In IOURequestStepDistanceRate.tsx:84, add a check for track expenses (similar to how MoneyRequestConfirmationList does it) so that shouldShowTax evaluates correctly for self-DM track distance expenses. The condition should include isTrackExpense alongside the existing isPolicyExpenseChat || isExpenseUnreported(currentTransaction) check, ensuring that when a user selects a new distance rate in the track expense flow, the tax fields are properly recomputed and saved to the transaction.

    What alternative solutions did you explore? (Optional)

    An alternative would be to fix the shouldKeepCurrentTaxSelection logic in MoneyRequestConfirmationList to detect when the rate has changed and allow the useEffect to update the tax code. However, this would be a more fragile approach since the root issue is that IOURequestStepDistanceRate should be computing and setting the correct tax values at the point of rate selection — matching the behavior it already has for policy expense chat flows.

    Related issues

    #79867 is a related issue about tax amount on the confirm page for distance expenses, though it covers a different scenario (empty reclaimable amount).


    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.

  8. 8 remaining items

  9. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Apr 8, 2026
  10. changed the title [-]Distance - Tax rate and amount do not update after selecting distance rate on confirm page[/-] [+][Due for payment 2026-04-14] Distance - Tax rate and amount do not update after selecting distance rate on confirm page[/+] on Apr 8, 2026
  11. melvin-bot commented on Apr 8, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  12. melvin-bot commented on Apr 8, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.53-7 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 2026-04-14. 🎊

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

    • @parasharrajat requires payment through NewDot Manual Requests
    • @FitseTLT requires payment (Needs manual offer from BZ)
  13. melvin-bot commented on Apr 8, 2026

    @melvin-bot

    @parasharrajat / @FitseTLT The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. melvin-bot commented on Apr 8, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. changed the title [-][Due for payment 2026-04-14] Distance - Tax rate and amount do not update after selecting distance rate on confirm page[/-] [+][Due for payment 2026-04-16] [Due for payment 2026-04-14] Distance - Tax rate and amount do not update after selecting distance rate on confirm page[/+] on Apr 9, 2026
  16. melvin-bot commented on Apr 9, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.54-7 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 2026-04-16. 🎊

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

    • @parasharrajat requires payment through NewDot Manual Requests
    • @FitseTLT requires payment (Needs manual offer from BZ)
  17. melvin-bot commented on Apr 9, 2026

    @melvin-bot

    @parasharrajat / @FitseTLT @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions