Skip to content

[$250] Distance- Expense preview and report header show the old rate when rate is updated in settings #83972

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.28-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: #74967
Email or phone of affected tester (no customers): isodjnosidjiojiojiso@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.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Create a manual distance expense.
  4. Go to workspace settings > Distance rates.
  5. Edit the distance rate used in Step 3 to another rate.
  6. Go back to self DM.
  7. Open the distance expense.

Expected Result:

Expense preview and report header will show the updated rate (similar to workspace distance expense).

Actual Result:

Expense preview and report header show the old rate, while Rate field shows the updated rate.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7092399_1772494937284.12.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @FitseTLT
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022028655815062611999
  • Upwork Job ID: 2028655815062611999
  • Last Price Increase: 2026-03-03
  • Automatic offers:
    • FitseTLT | Contributor | 110642850

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Mar 3, 2026
  2. melvin-bot commented on Mar 3, 2026

    @melvin-bot

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

  3. melvin-bot commented on Mar 3, 2026

    @melvin-bot

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

  4. melvin-bot commented on Mar 3, 2026

    @melvin-bot

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

  5. github-actions commented on Mar 3, 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.
  6. OSBotify commented on Mar 3, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #74967 - "Fix - [Unreported] Add distance rate to the distance expenses tracked in selfDM" by @FitseTLT (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #74967 introduced a regression where updated distance rates from workspace settings are not reflected in the expense preview and report header for track expenses in self DM. The PR attempted to fix rate handling for unreported track expenses but incompletely updated all the places where rates are displayed.

    Labels: Will remove DeployBlockerCash label as this is reproducible in staging only (not in production), and the issue states "Reproducible in production?: N/A - new feature, doesn't exist in prod"

    📋 Detailed Analysis

    Evidence

    PR #74967 was merged on 2026-02-28 and is included in the current staging deploy (9.3.28-0). The issue was reported on 2026-03-03 and explicitly linked to this PR by the bot. The bug only affects the new feature introduced by this PR (distance rates for track expenses in self DM).

    Root Cause

    The PR modified DistanceRequestUtils.getRate() to accept a new parameter policyForMovingExpenses to properly resolve rates for unreported track expenses. The PR updated MoneyRequestConfirmationList.tsx to pass this parameter:

    const mileageRate = DistanceRequestUtils.getRate({
        transaction,
        policy,
        ...(isMovingTransactionFromTrackExpense && {policyForMovingExpenses}),
        policyDraft,
    });

    However, the PR failed to update MoneyRequestView.tsx (line 420), which displays the rate in the expense details view:

    const {unit, rate} = DistanceRequestUtils.getRate({transaction: updatedTransaction ?? transaction, policy});

    Since policyForMovingExpenses is not passed here, when the rate is updated in workspace settings, the function cannot find the updated rate and returns undefined. This triggers the fallback logic (lines 426-428) that calculates the rate from transaction data, showing the old rate.

    Verification

    • The affected file is src/components/ReportActionItem/MoneyRequestView.tsx (modified by the PR)
    • The PR changes to DistanceRequestUtils.getRate() added the policyForMovingExpenses parameter
    • The PR updated the confirmation screen but not the details view
    • The Rate field itself (IOURequestStepDistanceRate.tsx) properly shows the updated rate because it reads directly from the policy settings
  7. 34 remaining items

  8. melvin-bot commented on Mar 17, 2026

    @melvin-bot

    @cristipaval @parasharrajat @FitseTLT @dylanexpensify 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!

  9. melvin-bot commented on Mar 31, 2026

    @melvin-bot

    @cristipaval @parasharrajat @FitseTLT @dylanexpensify this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  10. cristipaval commented on Apr 1, 2026

    @cristipaval
    Contributor

    Hmm.. I missed this one. I'll do my best to work on it this week.

  11. added and removed
    Weekly
    on Apr 2, 2026
  12. melvin-bot commented on Apr 2, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @cristipaval, @parasharrajat, @FitseTLT, @dylanexpensify 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!

  13. added
    Weekly
    and removed on Apr 3, 2026
  14. cristipaval commented on Apr 20, 2026

    @cristipaval
    Contributor

    This is a very rare use case, and it is fine because when the user reports it or submits it to someone, it correctly updates on the confirmation page.

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

Metadata

Metadata

Labels

BugEngineeringExternalWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions