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-10-30] [Exploratory] Copilot - Not here page when click Create expense in delegate mode #97769
Version Number: 9.4.49-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#96726 Email or phone of affected tester (no customers):duytestnguyen+311@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Critical User Impact Device used: Windows 11 Home/Chrome App Component: Money Requests
Action Performed:
Preconditions:
Account A grants Copilot access to Account B
Account B switches to act as Account A (delegate mode), open it in a secondary device
Have: an open report (which can have some actions)
Open
Open a submitted expense as Account B (acting as Account A)
Click on 'Submit' button (or any other button) on the preview report
Create a new report
Go to Account A browser/device (not delegate mode)
changed the title [-][Exploratory] Copilot- Not here page when click Create expense in delegate mode[/-][+][Exploratory] Copilot - Not here page when click Create expense in delegate mode[/+]on Aug 4, 2026
Inside canRequestMoney there is an early return that fires before the expense-report branch:
ReportUtils.ts:10713 — "no other participants and not your own policy expense chat" → false
ReportUtils.ts:10723-10725 — if (isMoneyRequestReport(report)) return canAddTransaction(report) — the same check the button used, but it is never reached.
An empty report is built with the owner as its only participant (buildOptimisticEmptyReport), so otherParticipants is always empty for the owner. The early return then hinges entirely on isOwnPolicyExpenseChat, which for an expense report is resolved through getParentReport — and that function reads onlyparentReportID, with no chatReportID fallback (about a dozen other call sites do use chatReportID ?? parentReportID).
That is what makes this look like a Copilot bug when it isn't really one. On the device that created the report, the optimistic report carries parentReportID, so the check passes. Account A's device never ran that optimistic build — it only has the server's copy of the report. If that copy resolves no parent policy expense chat, isOwnPolicyExpenseChat is false, canRequestMoney returns false, and you get "Not here" under a button that is still rendered.
Confidence: medium-high. The code path and the button/page divergence are verified in source. The exact field missing on Account A's copy (parentReportID vs. the parent chat's isOwnPolicyExpenseChat) is inferred — I could not get runtime state, so it needs one runtime check (below).
What changes do you think we should make in order to solve the problem?
Make the page gate agree with the button gate. In canRequestMoney (ReportUtils.ts:10707-10725), let expense reports skip the "no other participants" early return and fall through to the isMoneyRequestReport branch, so canAddTransaction(report) is the single source of truth for whether an expense can be added to an expense report. Add an isExpenseReport(report) exclusion to that early return rather than reordering the whole function — reordering would also skip the IOU manager/owner check that sits between the two.
This keeps the participants rule for chats and DMs, where it is meaningful, and removes it for expense reports, where the button already relies on canAddTransaction.
What alternative solutions did you explore? (Optional)
Alternatives and evidence
Alternative fix — give getParentReport a chatReportID fallback. This would repair isOwnPolicyExpenseChat resolution directly, and matches what ~12 other call sites already do. I did not recommend it because getParentReport is used broadly for threads, so it is a wider blast radius for the same outcome. It is worth doing as a follow-up regardless.
PR #96726 (listed in the report) is not the cause. Its whole diff is delegateAccountID plumbing whose only consumers are cosmetic "on behalf of" attribution fields on report actions; buildOptimisticReportPreview already resolved the identical value via its delegateEmail fallback, so it is behaviour-neutral even in delegate mode. It also merged into 9.4.49, while this was reported as reproducible on production 9.4.48-3, which does not contain the merge commit. That PR sits in Applause's "caught during regression testing" field while Bug source reads "Exploratory" — it records what the tester was exploring, not a bisection.
Delegate mode is probably incidental. The essential precondition looks like "the empty report was created in a different session than the one clicking Add expense" — Copilot is just how the tester produced that. Two runtime checks would settle both this and the parentReportID question, and neither needs a second account:
Create an empty report in a workspace chat, confirm "Add expense" opens the keypad, then Settings → Troubleshoot → Clear cache and restart, reopen the chat and tap "Add expense" again. If it now shows "Not here", the root cause is confirmed and Copilot is irrelevant.
On the failing device, inspect the report in Onyx and check whether parentReportID is set and whether the parent policy expense chat has isOwnPolicyExpenseChat: true.
I attempted the first check on web myself, but the test session came up on a blank page and could not be driven, so this is code-based analysis only.
Ruled out:ownerAccountID, managerID, and stateNum/statusNum all feed canAddTransaction, which the button gate calls identically. If any of them were wrong, the button would not have rendered at all. A second gate at withWritableReportOrNotFound.tsx:132 also produces "Not here", but IOURequestStartPage is exported without that HOC, so it is not the gate on this route. canUserPerformWriteAction inside canCreateRequest is a secondary candidate — it would fire if report.errorFields.createReport were set from a failed CreateAppReport, but that would normally surface a red-brick-road error on the report too.
Possibly related, not a duplicate:#99507 — "Not here page appears briefly when copiloting into agent's account". Different flow (a transient flash during copilot switch), but it also lands on the not-found page in delegate mode and may share the "report data not yet resolved on this device" theme.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97769) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Activity
applause-bot commentedon Aug 4, 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/551473693561cc58a97c6f50698f21ee03522a8f8c11a1f88ac93dc39fc03010
[-][Exploratory] Copilot- Not here page when click Create expense in delegate mode[/-][+][Exploratory] Copilot - Not here page when click Create expense in delegate mode[/+]MelvinBot commentedon Sep 5, 2026
Proposal
What is the root cause of that problem?
The "Add expense" button and the page it navigates to use two different permission checks, and they disagree for an empty expense report.
isAddExpenseActionis true — that is onlyisExpenseReport && canAddTransaction(report) && transactions.length === 0.startMoneyRequest(SUBMIT, iouReportID, …)and lands onIOURequestStartPage, which is gated byAccessOrNotFoundWrapper'sCREATEvariant →canCreateRequest→canRequestMoney.Inside
canRequestMoneythere is an early return that fires before the expense-report branch:ReportUtils.ts:10713— "no other participants and not your own policy expense chat" →falseReportUtils.ts:10723-10725—if (isMoneyRequestReport(report)) return canAddTransaction(report)— the same check the button used, but it is never reached.An empty report is built with the owner as its only participant (
buildOptimisticEmptyReport), sootherParticipantsis always empty for the owner. The early return then hinges entirely onisOwnPolicyExpenseChat, which for an expense report is resolved throughgetParentReport— and that function reads onlyparentReportID, with nochatReportIDfallback (about a dozen other call sites do usechatReportID ?? parentReportID).That is what makes this look like a Copilot bug when it isn't really one. On the device that created the report, the optimistic report carries
parentReportID, so the check passes. Account A's device never ran that optimistic build — it only has the server's copy of the report. If that copy resolves no parent policy expense chat,isOwnPolicyExpenseChatisfalse,canRequestMoneyreturnsfalse, and you get "Not here" under a button that is still rendered.Confidence: medium-high. The code path and the button/page divergence are verified in source. The exact field missing on Account A's copy (
parentReportIDvs. the parent chat'sisOwnPolicyExpenseChat) is inferred — I could not get runtime state, so it needs one runtime check (below).What changes do you think we should make in order to solve the problem?
Make the page gate agree with the button gate. In
canRequestMoney(ReportUtils.ts:10707-10725), let expense reports skip the "no other participants" early return and fall through to theisMoneyRequestReportbranch, socanAddTransaction(report)is the single source of truth for whether an expense can be added to an expense report. Add anisExpenseReport(report)exclusion to that early return rather than reordering the whole function — reordering would also skip the IOU manager/owner check that sits between the two.This keeps the participants rule for chats and DMs, where it is meaningful, and removes it for expense reports, where the button already relies on
canAddTransaction.What alternative solutions did you explore? (Optional)
Alternatives and evidence
Alternative fix — give
getParentReportachatReportIDfallback. This would repairisOwnPolicyExpenseChatresolution directly, and matches what ~12 other call sites already do. I did not recommend it becausegetParentReportis used broadly for threads, so it is a wider blast radius for the same outcome. It is worth doing as a follow-up regardless.PR #96726 (listed in the report) is not the cause. Its whole diff is
delegateAccountIDplumbing whose only consumers are cosmetic "on behalf of" attribution fields on report actions;buildOptimisticReportPreviewalready resolved the identical value via itsdelegateEmailfallback, so it is behaviour-neutral even in delegate mode. It also merged into 9.4.49, while this was reported as reproducible on production 9.4.48-3, which does not contain the merge commit. That PR sits in Applause's "caught during regression testing" field while Bug source reads "Exploratory" — it records what the tester was exploring, not a bisection.Delegate mode is probably incidental. The essential precondition looks like "the empty report was created in a different session than the one clicking Add expense" — Copilot is just how the tester produced that. Two runtime checks would settle both this and the
parentReportIDquestion, and neither needs a second account:parentReportIDis set and whether the parent policy expense chat hasisOwnPolicyExpenseChat: true.I attempted the first check on web myself, but the test session came up on a blank page and could not be driven, so this is code-based analysis only.
Ruled out:
ownerAccountID,managerID, andstateNum/statusNumall feedcanAddTransaction, which the button gate calls identically. If any of them were wrong, the button would not have rendered at all. A second gate atwithWritableReportOrNotFound.tsx:132also produces "Not here", butIOURequestStartPageis exported without that HOC, so it is not the gate on this route.canUserPerformWriteActioninsidecanCreateRequestis a secondary candidate — it would fire ifreport.errorFields.createReportwere set from a failedCreateAppReport, but that would normally surface a red-brick-road error on the report too.Possibly related, not a duplicate: #99507 — "Not here page appears briefly when copiloting into agent's account". Different flow (a transient flash during copilot switch), but it also lands on the not-found page in delegate mode and may share the "report data not yet resolved on this device" theme.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97769)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run · view recording
melvin-bot commentedon Sep 5, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (
External)melvin-bot commentedon Sep 5, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
49 remaining items
melvin-bot commentedon Oct 29, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 29, 2026
Payment Summary
Resolving PRs:
fix Copilot - Not here page when click Create expense in delegate mode #102346
Reviewer: @situchan owed $175 via NewDot
Assignee: @apeyada requires payment (Needs manual offer from BZ)
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Nov 2, 2026
Payment Summary
Contributor: @apeyada paid $250 via Upwork
Contributor+: @situchan due $250 via NewDot
@apeyada can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022117399309563470409
apeyada commentedon Nov 4, 2026
@mallenexpensify I accepted offer. Thank you
mallenexpensify commentedon Nov 4, 2026
@apeyada paid, summary updated above. Thx.
laurenreidexpensify commentedon Nov 11, 2026
Approved $250 @situchan New Expensify