Skip to content

[Due for payment 2026-04-30] Expense - Amount field is displayed empty on distance expense undeleted offline. #88073

Closed

Description

@nlemma

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.60-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: #86938
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least one workspace.

  1. Open the Expensify app.
  2. Open any workspace chat.
  3. Create a map distance expense.
  4. Delete the just created expense.
  5. Navigate to "Reports" > "Expenses"
  6. Tap on "Filters" > "Status" > "Deleted"
  7. Apply the selected filter.
  8. Once redirected to results, turn off internet connection.
  9. Long tap and select the just deleted distance expense.
  10. Tap on dropdown menu > "Undelete"
  11. Navigate to Self DM.
  12. Note that the just undeleted expense shows correct amount on preview.
  13. Open the expense.
  14. Note that "Amount" field is displayed empty, despite amount being visible on header.

Expected Result:

Amount on distance expense undeleted offline, should be correctly visible on preview and also on "Amount" field inside report.

Actual Result:

Amount of distance expense undeleted offline is visible on expense preview and on report header, but "Amount" field on report is displayed empty.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7131119_1776315815005.Undelete_5.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @rojiphil

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 16, 2026
  2. melvin-bot commented on Apr 16, 2026

    @melvin-bot

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

  3. melvin-bot commented on Apr 16, 2026

    @melvin-bot

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

  4. github-actions commented on Apr 16, 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 16, 2026

    @OSBotify
    Contributor

    Investigation Summary - Classification: Frontend bug - Causing PR: 86938 (Deleted transactions on search V2 by @jnowakow) - Recommendation: REVERT - The PR introduced offline undelete for deleted transactions in search but broke display of Amount field for distance expenses after offline undelete. DeployBlockerCash kept. Assigned: @jnowakow @rojiphil @luacmartins

  6. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Proposal

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

    After undeleting a distance expense offline, the "Amount" field inside the expense detail view is empty, even though the preview and report header show the correct amount.

    What is the root cause of that problem?

    The optimistic update in changeTransactionsReport overwrites the transaction's comment field with {hold: null} (returned by recalculateUnreportedTransactionDetails()), destroying distance-specific fields like comment.type, comment.customUnit (containing quantity, name, distanceUnit), and comment.waypoints.

    This happens because of JS object spread precedence — the later comment property at Transaction.ts:L1065 replaces the comment from ...transaction at L1063.

    MoneyRequestView gates the amount display behind hasRoute, which checks for routes.route0.geometry.coordinates or comment.customUnit.quantity — both lost after the overwrite. The preview/search list doesn't have this gate, which is why it still shows the amount correctly.

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

    Merge the comment instead of replacing it. In Transaction.ts:L1065, change:

    // Before:
    comment,
    
    // After:
    comment: comment ? {...transaction.comment, ...comment} : transaction.comment,

    This preserves all existing comment fields (type, customUnit, waypoints) while still setting hold: null for unreported transactions.

    Evidence chain
    1. recalculateUnreportedTransactionDetails() returns {comment: {hold: null}} — TransactionUtils/index.ts:L2796-L2803
    2. The optimistic Onyx merge spreads ...transaction then overwrites with comment: {hold: null} — Transaction.ts:L1059-L1070
    3. hasRoute() checks transaction.routes.route0.geometry.coordinates or comment.customUnit.quantity — TransactionUtils/index.ts:L1767-L1768
    4. MoneyRequestView gates amount display: shouldDisplayTransactionAmount = (isDistanceRequest && hasRoute) || !isDistanceRequest — MoneyRequestView.tsx:L293
    5. Preview path (TransactionPreviewUtils) does NOT gate on hasRoute, explaining why the preview shows the amount correctly

    What alternative solutions did you explore? (Optional)

    Alternatively, recalculateUnreportedTransactionDetails() could be modified to return a deep-mergeable structure rather than a flat comment object, but this would be more invasive. The spread-merge approach at the call site is simpler and more targeted.


    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.

  7. 4 remaining items

  8. changed the title [-]Expense - Amount field is displayed empty on distance expense undeleted offline.[/-] [+][Due for payment 2026-04-30] Expense - Amount field is displayed empty on distance expense undeleted offline.[/+] on Apr 23, 2026
  9. melvin-bot commented on Apr 23, 2026

    @melvin-bot

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

  10. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.61-4 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-30. 🎊

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

    • @rojiphil requires payment through NewDot Manual Requests
    • @jnowakow does not require payment (Contractor)
  11. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    @rojiphil 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]

  12. luacmartins commented on Apr 27, 2026

    @luacmartins
    Contributor

    This was a followup to the main delete PR. No payment due. Closing.

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