Skip to content

Reports - Inline edited cells return to original state when edited in offline mode. #88682

Closed

Description

@jponikarchuk

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.62-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: #83127
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11 / Chrome
App Component: Search

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Reports" > "All Expenses"
  3. Turn off internet connection.
  4. Create a manual expense.
  5. Click on the "Amount" cell on the transaction row of the just created expense.
  6. Edit to any different amount.
  7. Note that "Amount" cell changes to original amount automatically.
  8. Click on the "Merchant" cell.
  9. Make any edition to it.
  10. Note that "Merchant" cell returns to original merchant name automatically.

Expected Result:

Edited cells on transaction row, should display the editions made after being inline edited while in offline mode.

Actual Result:

Cells that are inline edited in offline mode, return automatically to original state instead of showing the editions made.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Bug
    on Apr 24, 2026
  2. melvin-bot commented on Apr 24, 2026

    @melvin-bot

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

  3. melvin-bot commented on Apr 24, 2026

    @melvin-bot

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

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #83127 - "Add inline editing to transaction table cells" by @mohammadjafarinejad (High confidence)
    Related Issues: N/A

    Recommendation: REVERT

    PR #83127 introduced the inline editing feature for transaction table cells, and the bug is directly caused by the new code it introduced. Reverting this PR should restore the previous behavior while the offline edge case is properly addressed.

    Assigned: @mohammadjafarinejad (PR author), @ahmedGaber93 (approving reviewer), @puneetlath (approving reviewer) from highest-confidence causing PR only
    Labels: No label changes made — DeployBlockerCash is correctly applied (App PR caused the issue); DeployBlocker is not present.

    Detailed Analysis

    Evidence

    • The bug was reported in version 9.3.62-0 on staging (not present in production), meaning it was introduced by a PR in the current staging deploy.
    • The melvin-bot already auto-assigned PR feat: Add inline editing for tables on desktop #83127 as the causing PR.
    • PR feat: Add inline editing for tables on desktop #83127 (merged 2026-04-21) introduced inline editing for the "Amount" and "Merchant" cells in the Search results transaction table — exactly the two cells called out in the bug report.
    • The reproduction steps (edit Amount or Merchant while offline → value reverts to original) precisely match the new code path this PR introduced.

    Verification

    • Affected files confirmed changed by PR feat: Add inline editing for tables on desktop #83127:
      • src/components/Table/EditableCell/useInlineEditState.ts — new hook managing edit state
      • src/components/TransactionItemRow/DataCells/MerchantCell.tsx — new inline merchant editing
      • src/components/TransactionItemRow/DataCells/TotalCell.tsx — new inline amount editing
      • src/libs/actions/TransactionInlineEdit.ts — new action file for inline edits
      • src/libs/actions/IOU/UpdateMoneyRequest.ts — IOU update functions called on save

    Root Cause

    The root cause is a combination of two problems in useInlineEditState.ts and TotalCell.tsx:

    1. useInlineEditState.save immediately resets localValue to value (the stale prop) after calling onSave. On line 38 of useInlineEditState.ts:

      setLocalValue(value);  // resets to the OLD value before Onyx optimistic update propagates
      

      When offline, the API call is queued, but the optimistic Onyx update must propagate through the React tree before the component re-renders with the new value prop. The synchronous setLocalValue(value) call wins the race and shows the old value.

    2. TotalCell displays amountToDisplay (derived from transactionItem prop) in its non-editing display slot (line 29 and 91 of TotalCell.tsx), not localValue. Even if localValue were correct, the display shown to the user after exiting edit mode is driven entirely by the Onyx-backed transactionItem prop. If the optimistic Onyx write hasn't propagated back yet, the stale value is displayed.

    Together: after the user saves an edit while offline, localValue is reset to the old value synchronously, and the display content is also the old Onyx value, so the cell immediately shows the pre-edit value. The edit appears to have been lost even though it was queued for the API.

  6. ahmedGaber93 commented on Apr 24, 2026

    @ahmedGaber93
    Contributor

    This only affects expenses created offline, and similar issue already exists in production.

    Expenses created online can still be edited offline without any issues.

    Similar issue on production:

    1. Navigate to Reports → All Expenses
    2. Go offline
    3. Create a new expense
    4. Open Inbox → Workspace expense chat, then edit the created expense
    5. Navigate back to Reports → All Expenses and verify the expense is not updated
    Screen.Recording.2026-04-24.at.7.52.24.AM.mov
  7. trjExpensify commented on Apr 24, 2026

    @trjExpensify
    Contributor

    Mhm...

    2026-04-24_13-09-02.mp4
  8. trjExpensify commented on Apr 24, 2026

    @trjExpensify
    Contributor

    Ah, you have to also create the expense offline to begin with. I can repro..

    2026-04-24_13-36-27.mp4

    Probably a candidate to demote, IMO. I think we should fix it if we can though.

  9. puneetlath commented on Apr 24, 2026

    @puneetlath
    Contributor

    Inline editing reverted.

  10. removed
    DeployBlockerCash
    on Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugEngineeringHourly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions