Skip to content

[$175] [Exploratory] Split - Report of Employee appears in Admin workspace chat after revert split #103833

Todo

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.7-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/77992157/folder/57600017/41237175/1844841065?sort=%2Bidentifier
Email or phone of affected tester (no customers): leungbratt6+121013@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 10/Chrome
App Component: Chat Report View

Action Performed:

Preconditions:
Create a new workspace with Delay submission manual and Add approvals enabled
Invite an Employee to the workspace
Steps:

  1. Open the New Dot app as the submitter
  2. Create an expense and submit the report to the workspace
  3. As the Admin, open the Employee's expense
  4. Click on More > Split > Save the split
  5. Click the split expense - More - Edit Splits - Remove split - Save
  6. Open the Admin workspace chat

Expected Result:

The report should be in the Employee Workspace chat only

Actual Result:

Report of Employee appears in Admin workspace chat after revert split

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7285039_1791872927368.revert.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7285039

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @grgia

Activity

  1. applause-bot commented on Oct 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/0b44aa7aa44c142b52c3d76cc894fac985fa094656f730c37edccb8772678bd4

  2. added
    Bug
    on Oct 19, 2026
  3. MelvinBot commented on Oct 19, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When the admin saves the edited splits, App looks up the workspace chat using the current user's account ID (the admin) instead of the report owner's (the employee). It then builds an optimistic report preview of the employee's report inside the admin's own workspace chat.

    • The employee's report is already submitted. Because of that, removing the split does not take the "revert split" path. It takes the normal edit-splits path (UpdateSplitTransaction). See SplitTransactionUpdate.ts:175-188 and L395.
    • On that path, the remaining split already lives in a workspace report, so isConfirmedWorkspaceTransaction is true. That triggers an override at SplitTransactionUpdate.ts:930-942. It calls getPolicyExpenseChat(currentUserPersonalDetails.accountID, ...), which returns the admin's chat. That chat replaces the correct employee chat that was already resolved from expenseReport.chatReportID (L348-L374).
    • getMoneyRequestInformation finds no preview for the employee's report in the admin's chat, so it creates one (MoneyRequestBuilder.ts:1706-1725). Removing a split changes the remaining split's amount, so this optimistic data is pushed. successData then clears its pending state, so the preview stays.

    The override was added for the self DM case, where the current user is always the owner. It came in with Add splits for unreported expenses. The API params contain no chat ID, so this is a frontend-only bug.

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

    In the override at SplitTransactionUpdate.ts:930-932, resolve the chat of the transaction's own report:

    1. Use the chat at existingTransactionReport.chatReportID.
    2. If that chat is not in Onyx, fall back to getPolicyExpenseChat(existingTransactionReport.ownerAccountID, policyID).
    3. If neither exists, skip the override so the existing expenseReport.chatReportID fallback applies.

    Optionally, set payeeAccountID and payeeEmail (L807-L809) to the report owner instead of the current user.

    Add a unit test in which an admin edits splits on another member's submitted report. It should assert that no reportActions update targets the admin's workspace chat.

    What alternative solutions did you explore? (Optional)

    Limit the override to the self DM context only (when chatReport is the self DM). This is narrower, but the owner-based lookup also fixes delegate and admin edits from any screen.

    Notes and open questions
    • This also likely affects normal edits (two or more splits, amount changed) on another member's report. The code takes the same override path. I have not reproduced this.
    • If the original split transaction ever has its real reportID in the admin's Onyx (instead of -2), the revert path would hit the same override. The fix above covers both paths.
    • I did not reproduce this in the browser, because the repro needs two accounts (employee and admin). The stray preview should disappear after a cache clear if it is local-only.

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


    view run

  4. added
    Daily
    and removed on Oct 19, 2026
  5. added
    External
    on Oct 19, 2026
  6. melvin-bot commented on Oct 19, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @FitseTLT (External)

  7. changed the title [-][Exploratory] Split - Report of Employee appears in Admin workspace chat after revert split[/-] [+][$175] [Exploratory] Split - Report of Employee appears in Admin workspace chat after revert split[/+] on Oct 19, 2026
  8. melvin-bot commented on Oct 19, 2026

    @melvin-bot
  9. melvin-bot commented on Oct 22, 2026

    @melvin-bot

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

  10. 31 remaining items

  11. expensify-chore-bot commented on Nov 27, 2026

    @expensify-chore-bot

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

  12. grgia commented on Dec 1, 2026

    @grgia
    Contributor

    Thank you @FitseTLT, go ahead with Melvin

  13. FitseTLT commented on Dec 1, 2026

    @FitseTLT
    Contributor

    @MelvinBot implement

  14. MelvinBot commented on Dec 1, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ❌ fail

    Browser verification was blocked: the web session reports connection_lost, and separate employee/admin sessions are unavailable. No browser assertions were verified or screenshots captured.

    Step Status
    Workspace setupCould not verify manual submission, approvals, or employee invitation because the session is disconnected.
    ⚠️
    Employee submits an expenseBlocked by the disconnected session and unavailable employee account.
    ⚠️
    Admin splits the expenseBlocked; the prerequisite expense flow was not completed.
    ⚠️
    Admin removes a split and savesBlocked; prerequisite splits were not created.
    ⚠️
    Report stays only in the employee workspace chatNot verified because the two-account browser flow could not run.
    ⚠️

    Implemented in Keep employee split report previews out of admin workspace chats, a draft PR assigned to FitseTLT. All 204 targeted tests passed, along with lint, typecheck, spelling, formatting, and Storybook smoke checks.


    view run

  15. grgia commented on Dec 4, 2026

    @grgia
    Contributor

    @FitseTLT what's the latest on this?

  16. FitseTLT commented on Dec 4, 2026

    @FitseTLT
    Contributor

    @FitseTLT what's the latest on this?

    Reviewing thx

  17. FitseTLT commented on Dec 4, 2026

    @FitseTLT
    Contributor

    @MelvinBot implement

  18. melvin-bot commented on Dec 4, 2026

    @melvin-bot

    The fix is already implemented in Keep employee split report previews out of admin workspace chats.

    That PR remains draft and conflicted. Previous publishing attempts were blocked by authorization errors; browser verification is also outstanding. I haven’t created a duplicate PR.

  19. FitseTLT commented on Dec 4, 2026

    @FitseTLT
    Contributor

    @MelvinBot implement

  20. melvin-bot commented on Dec 4, 2026

    @melvin-bot

    🤖 Draft PR created: #108916
    Mark it as "Ready for review" or ask me to do that for you when it is ready for review.

  21. melvin-bot commented on Dec 4, 2026

    @melvin-bot

    🤖 Web test steps verification results: ❌ fail

    Implemented in replacement draft PR: 211 tests passed, along with typecheck, lint, formatting, spelling, and both code reviews; the PR has no merge conflicts, but CI and reviewer assignment remain pending. Browser verification was blocked because separate employee/admin sessions are unavailable—not because an app regression was observed.

    Step Status
    Workspace setupManual submission, approvals, and employee invitation could not be verified.
    ➖
    Open as employeeA separate employee session is unavailable.
    ➖
    Create and submit expenseBlocked by the employee-session prerequisite.
    ➖
    Admin opens employee expenseSeparate employee/admin actors are unavailable.
    ➖
    Split and saveThe prerequisite employee expense was not established.
    ➖
    Remove split and saveNo browser split was created.
    ➖
    Open admin workspace chatThe required workspace chat was not established.
    ➖
    Report remains only in employee chatBrowser behavior remains unverified; automated regression tests passed.
    ➖
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugDailyExternalNot a priority

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions