Skip to content

[Due for payment 2026-05-11] [Due for payment 2026-05-07] iOS - Chat - WS chat becomes blank when opening and scrolling after duplicate expenses #89052

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: v9.3.64-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #88442
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: iPhone 12 mini / iOS 26.3.1
App Component: Other

Action Performed:

Preconditions:

  1. Set Submissions to Instantly
  2. Disable Approvals and Payments

Steps:

  1. Go to workspace chat
  2. Create two non-reimbursable expenses
  3. Retract each report (open report > More > Retract)
  4. Go to Spend > Expenses
  5. Bulk select both expenses
  6. Click dropdown button > Duplicate expenses
  7. Go back to workspace chat
  8. Try to scroll the workspace chat

Expected Result:

Chat should be clearly readable when reopening after duplicating the non-reimbursable expenses.

Actual Result:

When reopening the workspace chat, it becomes blank and when scrolling it is becoming blank.

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

Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Apr 28, 2026

    @melvin-bot

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

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #88442 - "Fix duplicate indicator on paid reports and error when bulk-duplicating non-reimbursable expenses" by @Krishna2323 (High confidence)
    Related Issues: #88257, #88300

    Recommendation: REVERT

    PR #88442 introduced changes to bulkDuplicateExpenses in src/libs/actions/IOU/Duplicate.ts specifically for the "instant-submit + submit-and-close + non-reimbursable" code path — the exact preconditions in the bug report (Submissions set to Instantly, Approvals and Payments disabled). The reported symptom (blank workspace chat after bulk-duplicating non-reimbursable expenses) is staging-only and aligns precisely with the merge date of April 27, 2026.

    Assigned: @Krishna2323 (PR author), @situchan and @JS00001 (approving reviewers)
    Labels: No label changes made — DeployBlockerCash is correctly applied, no DeployBlocker label was present.

    Detailed Analysis

    Evidence

    Verification

    • PR Fix duplicate indicator on paid reports and error when bulk-duplicating non-reimbursable expenses #88442 modifies src/libs/actions/IOU/Duplicate.ts — the primary file handling bulk expense duplication.
    • The change restructures the bulkDuplicateExpenses loop: it now conditionally creates a new optimistic IOU report ID per iteration (currentOptimisticIOUReportID, currentReportPreviewActionID) depending on policyWillSplitReport and canAddTransaction. This is a significant change to Onyx state write ordering and optimistic report handling.
    • The hold: undefined additions in createExpenseByType and duplicateExpenseTransaction are separate minor fixes, but the report-splitting loop logic is the prime suspect for the blank workspace chat on iOS.

    Root Cause

    The newly introduced per-iteration report splitting logic in bulkDuplicateExpenses generates fresh optimisticIOUReportID values mid-loop when policyWillSplitReport is true. Under the "Instantly submit + submit-and-close + non-reimbursable" policy, this causes each duplicated expense to create its own separate report with its own Onyx writes. The resulting pattern of multiple interleaved optimistic Onyx SET/MERGE operations for the workspace chat's report preview actions appears to leave the chat component in an invalid state on iOS, causing it to render blank and remain blank while scrolling.

  6. MelvinBot commented on Apr 28, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #88442 introduced policyWillSplitReport logic in Duplicate.ts:1022-1026. When all duplicated expenses are non-reimbursable under an instant-submit + submit-and-close policy, each expense now creates its own IOU report with its own REPORT_PREVIEW action in the workspace chat.

    Each iteration immediately auto-submits (shouldDeferAutoSubmit=false at line 1059), so the server closes each report right away. When the server responds, it clears pendingAction and sets shouldShow=false on the REPORT_PREVIEW actions (because the linked reports are closed). At that point, isVisiblePreviewOrMoneyRequest filters out all those actions (pendingAction === undefined && shouldShow === false), leaving the workspace chat with no visible content.

    On iOS specifically, the rapid synchronous Onyx updates (each loop iteration fires Onyx.update immediately via API/index.ts:82-84) combined with the SET/MERGE timing mismatch (acknowledged at Duplicate.ts:316-320) can cause the FlashList to receive data changes faster than it can complete layout, resulting in the blank/unscrollable state.

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

    The fix should be in bulkDuplicateExpenses to handle the policyWillSplitReport path correctly. Two approaches (in order of preference):

    1. Ensure REPORT_PREVIEW visibility is maintained: When policyWillSplitReport is true, the optimistic REPORT_PREVIEW actions should have shouldShow: true set explicitly, and the success/failure data should preserve this value rather than letting the server override it to false. The server may set shouldShow=false because it considers a closed/submitted report's preview as hidden — but in the workspace chat context, these previews should remain visible so the user can see their expense history.

    2. Batch the Onyx updates: Instead of calling API.write N times in a synchronous loop (each triggering an immediate Onyx.update), collect all optimistic data across iterations and apply them in a single Onyx.update call before firing the API requests. This would prevent the rapid re-render storm on iOS.

    What alternative solutions did you explore? (Optional)

    Investigation details

    Key evidence chain:

    1. policyWillSplitReport=true triggers at Duplicate.ts:1023-1026 — exact match for the repro conditions (instant submit, non-reimbursable)
    2. Each iteration resets the IOU report and creates a new REPORT_PREVIEW action at line 1044-1052
    3. shouldDeferAutoSubmit=false for ALL expenses at line 1059 — server closes reports immediately
    4. isVisiblePreviewOrMoneyRequest at ReportActionsUtils.ts:1565-1569 hides actions where pendingAction === undefined && shouldShow === false
    5. The code itself documents the SET/MERGE timing issue at Duplicate.ts:316-320

    Confidence: Medium — The code path analysis strongly supports this hypothesis. The one unverified piece is confirming that the server actually sets shouldShow=false on the REPORT_PREVIEW actions for submitted-and-closed reports, which is server-side behavior.


    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. sosek108 commented on Apr 28, 2026

    @sosek108
    Contributor

    May be duplicated or related to: #88955

  8. situchan commented on Apr 28, 2026

    @situchan
    Contributor

    @sosek108 please also add this issue and test case in #88923

  9. sosek108 commented on Apr 28, 2026

    @sosek108
    Contributor

    @situchan done.

  10. 1 remaining item

  11. melvin-bot commented on Apr 28, 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.

  12. JS00001 commented on Apr 28, 2026

    @JS00001
    Contributor

    requesting retest

  13. m-natarajan commented on Apr 28, 2026

    @m-natarajan

    Not repro in iPhone13/26.3.1, v9.3.64-10. Observed blank space after step 5

    Image
    ScreenRecording_04-28-2026.13-26-27_1.1.MP4
  14. melvin-bot commented on Apr 29, 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.

  15. changed the title [-]iOS - Chat - WS chat becomes blank when opening and scrolling after duplicate expenses[/-] [+][Due for payment 2026-05-07] iOS - Chat - WS chat becomes blank when opening and scrolling after duplicate expenses[/+] on Apr 30, 2026
  16. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 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-05-07. 🎊

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

    • @Krishna2323 requires payment through NewDot Manual Requests
    • @situchan requires payment through NewDot Manual Requests
  17. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    @Krishna2323 / @situchan 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]

  18. changed the title [-][Due for payment 2026-05-07] iOS - Chat - WS chat becomes blank when opening and scrolling after duplicate expenses[/-] [+][Due for payment 2026-05-11] [Due for payment 2026-05-07] iOS - Chat - WS chat becomes blank when opening and scrolling after duplicate expenses[/+] on May 4, 2026
  19. melvin-bot commented on May 4, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.65-6 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-05-11. 🎊

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

    • @Krishna2323 requires payment through NewDot Manual Requests
    • @situchan requires payment through NewDot Manual Requests
  20. melvin-bot commented on May 4, 2026

    @melvin-bot

    @Krishna2323 / @situchan 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]

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