Skip to content

[Due for payment 2026-07-03] Distance - Date change system message does not appear when it involves rate change #94520

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.19-1
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: #93755
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.70/mi, valid Jan 1 2025 - Dec 31 2025
    Rate B: $0.50/mi, valid Jan 1 2026 - Dec 31 2026
  1. Go to staging.new.expensify.com.
  2. Go to workspace chat.
  3. Create a distance expense with date from 2025.
  4. Open the expense.
  5. Click Date.
  6. Change the date to 2026.

Expected Result:

Date change system message will appear in the expense.

Actual Result:

Date change system message does not appear in the expense when it involves rate change.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7190190_1782333604117.9.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @c3024

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 24, 2026
  2. applause-bot commented on Jun 24, 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/1b1b109cfc6e57ddd57f8d857731ee8bae5d0ead8b7eaa17618c7af7341120da

  3. melvin-bot commented on Jun 24, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 24, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 24, 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 Jun 24, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When a date edit also moves the expense into a different mileage rate window, PR #93755 routes the edit through updateMoneyRequestDistanceRate and bundles both changes into a single transactionChanges object (created + customUnitRateID) — see UpdateMoneyRequest.ts. The resulting modified-expense report action therefore carries oldCreated/created and oldAmount/amount/oldMerchant/merchant.

    The system message text is built by getForReportAction in ModifiedExpenseMessage.ts. Because the merchant is in distance format (contains @), it hits the early return getForDistanceRequest(...) at ModifiedExpenseMessage.ts:293-295. That early return means execution never reaches the date fragment block at ModifiedExpenseMessage.ts:329-332, so the "changed the date" part of the message is silently dropped. Only the rate/distance change is shown.

    This is why the date change message appears for a plain date edit but disappears whenever the edit also triggers a rate change.

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

    In getForReportAction, when the action is a distance edit that also has a created change (oldCreated + created present), do not return early with only the distance message. Instead, build the date fragment as well and combine it with the distance/rate fragment so both changes are reflected in one system message (e.g. "changed the date to … and the rate to …").

    Concretely, compute the distance-request message string and the date fragment, then merge them through the existing setFragments/changeFragments joining logic rather than returning immediately at line 294. The plain date-only and rate-only paths should remain unchanged.

    What alternative solutions did you explore? (Optional)

    • Keep the date and rate edits as two separate report actions (revert the bundling from Recalculate mileage rate when editing distance expense date #93755) so each renders its own message — larger behavioral change and likely undesirable.
    • Have getForDistanceRequest itself accept and append the date change — keeps the change localized but couples date formatting into the distance helper.
    Confidence & evidence

    Confidence: High. The symptom ("date change message missing only when rate also changes") is fully explained by the early return at ModifiedExpenseMessage.ts:294, which structurally bypasses the date fragment builder. The bundling of created + customUnitRateID into one transaction change was introduced by the flagged PR #93755, which is why this is a new deploy blocker. The rendering path is deterministic from the action's originalMessage, so this drops the date regardless of whether the message comes from the optimistic update or the server response.

    Not yet verified at runtime / in logs — analysis is from code only.


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

  7. neil-marcellini commented on Jun 24, 2026

    @neil-marcellini
    Contributor

    I don't think this needs to be a blocker because the feature is still under a beta.

  8. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jun 24, 2026
  9. 15 remaining items

  10. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. c3024 commented on Jun 30, 2026

    @c3024
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Precondition:

    • Enable Distance rates on a workspace and create two date-bound mileage rates, e.g. Rate A: $0.70/mi valid Jan 1 2025 – Dec 31 2025, and Rate B: $0.50/mi valid Jan 1 2026 – Dec 31 2026.
    • Create a workspace distance expense with a date in 2025 (so it uses Rate A).

    Test:

    1. Open the workspace distance expense.
    2. Tap Date and change the date to a day in 2026 (so the applicable rate switches to Rate B), then save.
    3. Open the expense's chat/thread.
    4. Verify a system message appears that reports BOTH changes — the rate change and the date change (e.g. "changed the rate to ... (previously ...), which updated the amount to ... (previously ...)" followed by "changed the date to 2026-... (previously 2025-...)").
    5. Tap Date again and change it to another day within the same 2026 window (so the rate does NOT change), then save.
    6. Verify the system message reports the date change ("changed the date to ... (previously ...)").

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-d30c-a256-768a-85e804a9ee94
  12. melvin-bot commented on Jul 3, 2026

    @melvin-bot

    @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  13. melvin-bot commented on Jul 4, 2026

    @melvin-bot

    @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  14. c3024 commented on Jul 4, 2026

    @c3024
    Contributor

    No payment is due here. This issue is open only to add the regression test.

  15. melvin-bot commented on Jul 7, 2026

    @melvin-bot

    @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. c3024 commented on Jul 8, 2026

    @c3024
    Contributor

    @mallenexpensify there is no payment due here but we have a regression test to add.

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions