Skip to content

[Due for payment 2026-10-30] [Exploratory] Copilot - Not here page when click Create expense in delegate mode #97769

Closed

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: 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)
  1. Open
  2. Open a submitted expense as Account B (acting as Account A)
  3. Click on 'Submit' button (or any other button) on the preview report
  4. Create a new report
  5. Go to Account A browser/device (not delegate mode)
  6. Go to workspace chat
  7. Click 'Add expense' button on empty report

Expected Result:

Number pad page opened

Actual Result:

Not here page appears

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7225339_1785828627351.bandicam_2026-08-04_14-16-47-375.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @apeyada

Activity

  1. applause-bot commented on Aug 4, 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/551473693561cc58a97c6f50698f21ee03522a8f8c11a1f88ac93dc39fc03010

  2. 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
  3. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 5, 2026
  4. MelvinBot commented on Sep 5, 2026

    @MelvinBot
    Contributor

    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.

    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 only parentReportID, 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:

    1. 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.
    2. 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.


    view run · view recording

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 5, 2026
  6. melvin-bot commented on Sep 5, 2026

    @melvin-bot

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

  7. melvin-bot commented on Sep 5, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  8. 49 remaining items

  9. melvin-bot commented on Oct 29, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  10. melvin-bot commented on Oct 29, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  11. mallenexpensify commented on Nov 2, 2026

    @mallenexpensify
    Contributor

    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

  12. apeyada commented on Nov 4, 2026

    @apeyada
    Contributor

    @mallenexpensify I accepted offer. Thank you

  13. added and removed on Nov 4, 2026
  14. mallenexpensify commented on Nov 4, 2026

    @mallenexpensify
    Contributor

    @apeyada paid, summary updated above. Thx.

  15. laurenreidexpensify commented on Nov 11, 2026

    @laurenreidexpensify
    Contributor

    Approved $250 @situchan New Expensify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorNot a priority

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions