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
[Due for payment 2026-03-18][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly #83544
Version Number: 9.3.26-4 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/folder/13176687/test-cases/41236700 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: MacBook Air 15.7.4 Chrome App Component: Money Requests
Action Performed:
Preconditions: User A added User B as a copilot with limited access
As User A, create a workspace with submission frequency set to manual, enabled approvals and payments
As User A, add an expense in the workspace chat
Sign in as User B, switch to the User A's account
As User B, open expense details from step 2, click Submit
As User B, open More menu, click Retract
Observe the system message
Expected Result:
Limited copilot is not able to retract expense. When the copilot account retracts the expense, main account's avatar does not appear briefly above the "retracted" system message
Actual Result:
Limited copilot as able to retract the expense.
When the full or limited copilot submits the expense, then retracts it, the system message appears with the main account avatar briefly
changed the title [-]Copilot - Limited copilot can retract expense, main account avatar appears briefly[/-][+][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly[/+]on Feb 26, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-26 09:12:02 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Limited copilot as able to retract the expense.
When the full or limited copilot submits the expense, then retracts it, the system message appears with the main account avatar briefly
What is the root cause of that problem?
We don't show the limit access model for retract action like reject
We also need to check for other secondary actions if it has the same problem
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
⚠️@MobileMage Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Please re-state the problem that we are trying to solve in this issue.
There are two bugs when a copilot interacts with expenses:
Permission bug: A limited copilot (delegate with "submitter" role) can retract an expense, when they should not be allowed to.
Avatar bug: When any copilot (full or limited) retracts an expense, the main account's avatar briefly flashes above the "retracted" system message before being corrected by the server response.
What is the root cause of that problem?
Bug 1 (Permission): The RETRACT action handler in MoneyReportHeader.tsx is missing the isDelegateAccessRestricted check. Every other write action in the same file (PAY, APPROVE, UNAPPROVE, HOLD, REMOVE_HOLD, REJECT) checks isDelegateAccessRestricted and shows the delegate-no-access modal before proceeding. The RETRACT handler at line 1576 directly calls retractReport() with no guard.
For comparison, the HOLD handler at line 1365 follows the correct pattern:
if (isDelegateAccessRestricted) {
showDelegateNoAccessModal();
return;
}
Bug 2 (Avatar): The buildOptimisticRetractedReportAction function in ReportUtils.ts:8061-8085 does not set delegateAccountID on the optimistic report action. Without this field, the avatar rendering code in useReportActionAvatars.ts cannot detect a delegate is acting, so it falls through to actorAccountID (the main account). When the server response arrives with the correct delegateAccountID, the avatar corrects itself — producing the brief flash.
Other optimistic action builders like buildOptimisticSubmittedReportAction at line 7389 correctly include delegateAccountID: delegateAccountDetails?.accountID.
What changes do you think we should make in order to solve the problem?
Fix 1 — Add delegate restriction check to RETRACT handler:
In src/components/MoneyReportHeader.tsx, add the isDelegateAccessRestricted guard to the RETRACT onSelected handler (around line 1576), matching the pattern used by HOLD, REJECT, UNAPPROVE, etc.:
Fix 2 — Add delegateAccountID to optimistic retracted action:
In src/libs/ReportUtils.ts:
Add 'delegateAccountID' to the OptimisticRetractedReportAction Pick type (line 543-546).
In buildOptimisticRetractedReportAction (line 8061), resolve the delegate details and include delegateAccountID:
const delegateAccountDetails = getPersonalDetailByEmail(delegateEmail);
// Then in the return object:
delegateAccountID: delegateAccountDetails?.accountID,
What alternative solutions did you explore? (Optional)
The REOPEN action handler at line 1585 has the same missing isDelegateAccessRestricted check. Additionally, buildOptimisticReopenedReportAction (line 8088) and buildOptimisticRejectReportAction (line 12632) have the same missing delegateAccountID pattern. These may warrant fixes in the same PR to prevent similar copilot issues.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
changed the title [-][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly[/-][+][Due for payment 2026-03-18][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly[/+]on Mar 17, 2026
Activity
melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to @brianlee-expensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.[-]Copilot - Limited copilot can retract expense, main account avatar appears briefly[/-][+][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly[/+]melvin-bot commentedon Feb 26, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022026945522407032258
nkdengineer commentedon Feb 26, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-26 09:12:02 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Limited copilot as able to retract the expense.
When the full or limited copilot submits the expense, then retracts it, the system message appears with the main account avatar briefly
What is the root cause of that problem?
App/src/components/MoneyReportHeader.tsx
Line 1577 in 9adcde0
delegateAccountIDto optimistic retract action then the main avatar is displayed brieflyApp/src/libs/ReportUtils.ts
Line 8061 in 9adcde0
What changes do you think we should make in order to solve the problem?
App/src/components/MoneyReportHeader.tsx
Line 1577 in 9adcde0
delegateAccountIDto the optimistic retract actionApp/src/libs/ReportUtils.ts
Line 8061 in 9adcde0
We also need to check for other secondary actions if it has the same problem
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
MobileMage commentedon Feb 26, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Feb 26, 2026
MelvinBot commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
There are two bugs when a copilot interacts with expenses:
What is the root cause of that problem?
Bug 1 (Permission): The RETRACT action handler in
MoneyReportHeader.tsxis missing theisDelegateAccessRestrictedcheck. Every other write action in the same file (PAY, APPROVE, UNAPPROVE, HOLD, REMOVE_HOLD, REJECT) checksisDelegateAccessRestrictedand shows the delegate-no-access modal before proceeding. The RETRACT handler at line 1576 directly callsretractReport()with no guard.For comparison, the HOLD handler at line 1365 follows the correct pattern:
Bug 2 (Avatar): The
buildOptimisticRetractedReportActionfunction inReportUtils.ts:8061-8085does not setdelegateAccountIDon the optimistic report action. Without this field, the avatar rendering code inuseReportActionAvatars.tscannot detect a delegate is acting, so it falls through toactorAccountID(the main account). When the server response arrives with the correctdelegateAccountID, the avatar corrects itself — producing the brief flash.Other optimistic action builders like
buildOptimisticSubmittedReportActionat line 7389 correctly includedelegateAccountID: delegateAccountDetails?.accountID.What changes do you think we should make in order to solve the problem?
Fix 1 — Add delegate restriction check to RETRACT handler:
In
src/components/MoneyReportHeader.tsx, add theisDelegateAccessRestrictedguard to the RETRACTonSelectedhandler (around line 1576), matching the pattern used by HOLD, REJECT, UNAPPROVE, etc.:Fix 2 — Add
delegateAccountIDto optimistic retracted action:In
src/libs/ReportUtils.ts:'delegateAccountID'to theOptimisticRetractedReportActionPick type (line 543-546).buildOptimisticRetractedReportAction(line 8061), resolve the delegate details and includedelegateAccountID:What alternative solutions did you explore? (Optional)
The REOPEN action handler at line 1585 has the same missing
isDelegateAccessRestrictedcheck. Additionally,buildOptimisticReopenedReportAction(line 8088) andbuildOptimisticRejectReportAction(line 12632) have the same missingdelegateAccountIDpattern. These may warrant fixes in the same PR to prevent similar copilot issues.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.16 remaining items
nkdengineer commentedon Mar 9, 2026
@brunovjk The PR is ready for review.
brunovjk commentedon Mar 17, 2026
PR went into production on March 11th according to this deploy checklist.
[-][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly[/-][+][Due for payment 2026-03-18][$250] Copilot - Limited copilot can retract expense, main account avatar appears briefly[/+]melvin-bot commentedon Mar 17, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)brianlee-expensify commentedon Mar 18, 2026
Payment Summary
twisterdotcom commentedon Mar 19, 2026
@brunovjk has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-f72b-a8ab-c323-c11e717d27b4