You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$175] [Exploratory] Split - Report of Employee appears in Admin workspace chat after revert split #103833
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?
Use the chat at existingTransactionReport.chatReportID.
If that chat is not in Onyx, fall back to getPolicyExpenseChat(existingTransactionReport.ownerAccountID, policyID).
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.
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
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.
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.
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.
Activity
applause-bot commentedon Oct 13, 2026
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
MelvinBot commentedon Oct 19, 2026
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.
UpdateSplitTransaction). See SplitTransactionUpdate.ts:175-188 and L395.isConfirmedWorkspaceTransactionis true. That triggers an override at SplitTransactionUpdate.ts:930-942. It callsgetPolicyExpenseChat(currentUserPersonalDetails.accountID, ...), which returns the admin's chat. That chat replaces the correct employee chat that was already resolved fromexpenseReport.chatReportID(L348-L374).getMoneyRequestInformationfinds 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.successDatathen 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:
existingTransactionReport.chatReportID.getPolicyExpenseChat(existingTransactionReport.ownerAccountID, policyID).expenseReport.chatReportIDfallback applies.Optionally, set
payeeAccountIDandpayeeEmail(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
reportActionsupdate targets the admin's workspace chat.What alternative solutions did you explore? (Optional)
Limit the override to the self DM context only (when
chatReportis the self DM). This is narrower, but the owner-based lookup also fixes delegate and admin edits from any screen.Notes and open questions
reportIDin the admin's Onyx (instead of-2), the revert path would hit the same override. The fix above covers both paths.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
melvin-bot commentedon Oct 19, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @FitseTLT (
External)[-][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[/+]melvin-bot commentedon Oct 19, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022112159428493644892
melvin-bot commentedon Oct 22, 2026
@FitseTLT Whoops! This issue is 2 days overdue. Let's get this updated quick!
31 remaining items
expensify-chore-bot commentedon Nov 27, 2026
@grgia Whoops! This issue is 2 days overdue. Let's get this updated quick!
grgia commentedon Dec 1, 2026
Thank you @FitseTLT, go ahead with Melvin
FitseTLT commentedon Dec 1, 2026
@MelvinBot implement
MelvinBot commentedon Dec 1, 2026
🤖 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.Workspace setup
Could not verify manual submission, approvals, or employee invitation because the session is disconnected.Employee submits an expense
Blocked by the disconnected session and unavailable employee account.Admin splits the expense
Blocked; the prerequisite expense flow was not completed.Admin removes a split and saves
Blocked; prerequisite splits were not created.Report stays only in the employee workspace chat
Not 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
grgia commentedon Dec 4, 2026
@FitseTLT what's the latest on this?
FitseTLT commentedon Dec 4, 2026
Reviewing thx
FitseTLT commentedon Dec 4, 2026
@MelvinBot implement
melvin-bot commentedon Dec 4, 2026
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.
FitseTLT commentedon Dec 4, 2026
@MelvinBot implement
melvin-bot commentedon Dec 4, 2026
🤖 Draft PR created: #108916
Mark it as "Ready for review" or ask me to do that for you when it is ready for review.
melvin-bot commentedon Dec 4, 2026
🤖 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.
Workspace setup
Manual submission, approvals, and employee invitation could not be verified.Open as employee
A separate employee session is unavailable.Create and submit expense
Blocked by the employee-session prerequisite.Admin opens employee expense
Separate employee/admin actors are unavailable.Split and save
The prerequisite employee expense was not established.Remove split and save
No browser split was created.Open admin workspace chat
The required workspace chat was not established.Report remains only in employee chat
Browser behavior remains unverified; automated regression tests passed.