Skip to content

[$250] Distance-Split distance shows YER currency instead INR #83606

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.26-4
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #82257
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: Redminote 10S Android 13
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Create workpace with INR currency [default currency]
  3. Open workspace chat
  4. Create a distance manual expense
  5. Go to workspace settings - overview - currency
  6. Change to YER
  7. Go to workspace chat
  8. Open the expense
  9. Tap more - split

Expected Result:

Split distance must show INR currency.

Actual Result:

Split distance shows YER currency instead INR.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7089444_1772127549265.Screenrecorder-2026-02-26-23-04-01-785.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ahmedGaber93
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022027091070414553218
  • Upwork Job ID: 2027091070414553218
  • Last Price Increase: 2026-02-26

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 26, 2026
  2. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 26, 2026

    @melvin-bot

    Triggered auto assignment to @sonialiap (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 Feb 26, 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. MelvinBot commented on Feb 26, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When a user creates a distance expense on a workspace with INR currency, then changes the workspace currency to YER, and then splits the distance expense, the split shows YER currency instead of the original INR. The split flow uses the workspace's current currency for rate/merchant calculations rather than the original transaction's currency.

    What is the root cause of that problem?

    The root cause is in how the split expense flow retrieves the mileage rate for distance calculations. Every distance-related split operation calls DistanceRequestUtils.getRate({transaction, policy}) with the current policy object. This function reads the mileage rate (including its currency) from the policy's current custom unit configuration (DistanceRequestUtils.ts:388-398):

    currency: mileageRate?.currency ?? policyCurrency
    

    When the workspace currency changes from INR to YER, the policy's distance custom unit rates are updated to reflect YER. So getRate() now returns a rate with currency: "YER".

    This rate is then passed to updateSplitExpenseDistanceFromAmount() in Split.ts:1914, where the currency priority is:

    mileageRate?.currency ?? transactionCurrency ?? CONST.CURRENCY.USD
    

    Since mileageRate.currency (YER from the current policy) takes precedence over transactionCurrency (INR from the original transaction), the merchant string and rate calculations all use the wrong currency. This affects six call sites in Split.ts (lines ~2062, ~2136, ~2203, ~2320, ~2386) and the SplitExpenseEditPage.tsx.

    Note: The transaction's currency field itself is correctly set from the original transaction (Split.ts:1170), so the stored currency is right — but the displayed merchant strings and rate calculations are wrong.

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

    In updateSplitExpenseDistanceFromAmount() (Split.ts), the currency used for the merchant string should prioritize the original transaction's currency over the mileage rate's currency. The fix is to change the currency priority in the getDistanceMerchantFromDistance call from:

    mileageRate?.currency ?? transactionCurrency ?? CONST.CURRENCY.USD
    

    to:

    transactionCurrency ?? mileageRate?.currency ?? CONST.CURRENCY.USD
    

    This ensures the original transaction's currency (INR) is used for the merchant display string, not the current policy rate's currency (YER). The same pattern should be checked in updateSplitExpenseField and updateSplitExpenseAmountField where similar currency priority exists.

    What alternative solutions did you explore? (Optional)

    An alternative would be to snapshot the mileage rate and its currency on the transaction at creation time, so the split flow reads from the transaction's stored rate rather than looking it up from the live policy. However, this would be a larger change. The simpler fix of prioritizing transactionCurrency in the merchant calculation addresses the immediate display issue.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 26, 2026
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 26, 2026
  9. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  10. changed the title [-]Distance-Split distance shows YER currency instead INR[/-] [+][$250] Distance-Split distance shows YER currency instead INR[/+] on Feb 26, 2026
  11. melvin-bot commented on Feb 26, 2026

    @melvin-bot
  12. puneetlath commented on Feb 26, 2026

    @puneetlath
    Contributor

    @MelvinBot can you raise the PR?

  13. MelvinBot commented on Feb 26, 2026

    @MelvinBot
    Contributor

    Draft PR created: #83618

    The fix swaps the currency fallback priority in two places in Split.ts so the original transaction's currency takes precedence over the current policy's mileage rate currency. All 53 existing split tests pass.

    Please mark it as "Ready for review" when it is ready for review.

  14. m-natarajan commented on Feb 27, 2026

    @m-natarajan

    Not reproduce, Chrome / v9.3.26-8 (Waiting for the validation result for Android)

    Screen.Recording.2026-02-27.at.15.33.16.mp4
  15. Waryjustice commented on Mar 6, 2026

    @Waryjustice

    can i be assigned this issue

  16. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    📣 @Waryjustice! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  17. ahmedGaber93 commented on Mar 9, 2026

    @ahmedGaber93
    Contributor

    @sonialiap I think we can close this now. PR is deployed and issue is not reproduced #83606 (comment).

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.EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions