Skip to content

[Due for payment 2026-06-24] Distance - Rate change tooltip shows up when destination is a different workspace #93515

Closed

Description

@applause-bot

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.4.7-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: #93103
Email or phone of affected tester (no customers): applausetester+ssndjois2jd1@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account.
  • Enable Distance rates.
  • Create the following distance rates:
    Rate A: $0.67/mi, valid Jan 1 2025 - Dec 31 2025
    Rate B: $0.70/mi, valid Jan 1 2026 - Dec 31 2026
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Create a distance expense with date in 2025.
  4. Click Submit it to someone.
  5. Select a non-default workspace (create one if there is only one workspace).

Expected Result:

Rate change tooltip will not show up when destination is a different workspace.

Actual Result:

Rate change tooltip shows up when destination is a different workspace. The rate itself is invalid for that workspace.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7179453_1781305766784.23.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7179453

Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jun 13, 2026
  2. applause-bot commented on Jun 13, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/3dc8d89d14617395241d6fe432fde6375ae01d17444ca970ad1a4db766335749

  3. melvin-bot commented on Jun 13, 2026

    @melvin-bot

    @rlinoz recently merged #93103, but they are OOO right now, so I'll auto-assign someone else.

  4. melvin-bot commented on Jun 13, 2026

    @melvin-bot

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

  5. melvin-bot commented on Jun 13, 2026

    @melvin-bot

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

  6. github-actions commented on Jun 13, 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.
  7. MelvinBot commented on Jun 13, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When a distance expense is created in the Self DM with a 2025 date and then submitted to a different (non-default) workspace, the "We updated the rate based on your travel date" tooltip incorrectly appears on the Rate field — even though the selected rate is invalid for that workspace and no date-driven rate update happened there.

    What is the root cause of that problem?

    The tooltip is driven by a rateAutoUpdated flag stored on the transaction draft:

    MoneyRequestConfirmationList.tsx:259

    const shouldShowRateAutoUpdatedTooltip = isDistanceRequest && !!transaction?.comment?.customUnit?.rateAutoUpdated;

    That flag is set to true when the date changes and the date-aware rate selection picks a different rate, in IOURequestStepDate.tsx:138:

    setCustomUnitRateID(transactionID, rateID, transaction, effectivePolicy, rateID !== currentRateID);

    In the Self DM (track expense) flow, setting the date to 2025 auto-selects Rate A and sets rateAutoUpdated: true. When the expense is then submitted to a different workspace, the policy-change effect in DistanceRequestController.tsx runs. If the rate is invalid for the new workspace, it hits the error branch DistanceRequestController.tsx:110 (setFormError) and never clears rateAutoUpdated. The stale flag from the Self-DM context persists, so the tooltip shows alongside an invalid-rate error.

    Why the other branches don't hit this
    • The matching-rate branch DistanceRequestController.tsx:104 calls setCustomUnitRateID(...) without the rateAutoUpdated arg, so it resets to false (default param) — no bug there.
    • The clear-error early-return branch DistanceRequestController.tsx:96-99 also leaves the flag untouched (stale-true is possible if the same rate ID exists across workspaces, but the primary repro is the invalid-rate path).
    • The date-aware auto-select effect DistanceRequestController.tsx:167-202 only runs when customUnitRateID is -1/FAKE_P2P_ID, so it doesn't recompute the flag here.

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

    Reset rateAutoUpdated to false whenever the workspace/policy changes, since the "updated based on your travel date" determination was made in a different policy's rate context and is no longer meaningful. The cleanest place is the policy-change effect in DistanceRequestController.tsx: in the clear-error and setFormError branches, clear the flag (e.g. via Onyx.merge on the transaction draft, or a small helper) so it's only ever true when this policy's rate genuinely auto-updated due to a date change.

    A minimal mitigation (alone or in addition) is to also gate the tooltip on the absence of a rate error so it can never show on an invalid rate — e.g. in RateField.tsx:68 pass !!shouldShowRateAutoUpdatedTooltip && !shouldDisplayDistanceRateError. This directly covers the reported repro (rate is invalid for the new workspace) but doesn't clear the stale flag, so the policy-change reset is the more complete fix.

    What alternative solutions did you explore?

    Resetting the flag in the submission/participant-selection path (useParticipantSubmission.ts) — those setCustomUnitRateID calls already default rateAutoUpdated to false, so the leak is specifically in the confirmation-page policy-change effect, which is why that's the recommended target.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93515) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  8. melvin-bot commented on Jun 13, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  9. added
    Reviewing
    on Jun 15, 2026
  10. 2 remaining items

  11. added
    Daily
    and removed
    Hourly
    DeployBlockerCash
    on Jun 15, 2026
  12. rlinoz commented on Jun 15, 2026

    @rlinoz
    Contributor

    Behind a beta

  13. removed
    Reviewing
    on Jun 17, 2026
  14. changed the title [-]Distance - Rate change tooltip shows up when destination is a different workspace[/-] [+][Due for payment 2026-06-24] Distance - Rate change tooltip shows up when destination is a different workspace[/+] on Jun 17, 2026
  15. melvin-bot commented on Jun 17, 2026

    @melvin-bot

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

  16. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.9-0 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-06-24. 🎊

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

    • @Krishna2323 requires payment through NewDot Manual Requests
    • @thelullabyy requires payment (Needs manual offer from BZ)
  17. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    @Krishna2323 / @thelullabyy 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  18. rlinoz commented on Jun 17, 2026

    @rlinoz
    Contributor

    This was a regression we can close this one.

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions