Skip to content

[Due for payment 2026-09-23] Update category - Concierge replies "This chat/report does not have expenses" #97945

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.51-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #97879
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: iPhone 15 iOS 26.5.2
App Component: Money Requests

Action Performed:

  1. Navigate to an expense report with multiple transactions
  2. Open Concierge Anywhere from the side pane (tap the concierge icon in the report)
  3. Send a message to Concierge "Update all transactions in this report to have category Car"

Expected Result:

Verify the update succeeds for all transactions in the report

Actual Result:

Concierge replies "I checked your workspace and Car is a valid category, but this chat/ report doesn't have any expenses on it right now, so there was nothing I could update"

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7227119_1785997384001.Update_category_1.mp4

View all open jobs on GitHub

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

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 6, 2026
  2. applause-bot commented on Aug 6, 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/7b8bc41f4181eeee6ba5daa92d48d17f9c25cd7e1a6502d0516c8db639570870

  3. changed the title [-]Update category-Concierge replies "This chat/report does not have expenses"[/-] [+]iOS app - Update category - Concierge replies "This chat/report does not have expenses"[/+] on Aug 6, 2026
  4. MelvinBot commented on Aug 6, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    On native (iOS/Android), Concierge Anywhere never attaches the source expense report's context to the message it sends to Concierge. Concierge therefore only sees its own chat report — which has no expenses — and replies "this chat/report doesn't have any expenses on it."

    The report context (reportID, selectedTransactionIDs, selectedReportIDs) is only built when isInSidePanel === true, and the side panel is a web-only code path. On native there is no side panel: useSidePanelContext returns undefined, so the AddComment request carries only the Concierge chat reportID + the raw text — no reference to the report the user was actually viewing. The backend already understands sidePanelContext (that's why the same flow works on web), so this is purely an App/native gap, not a backend bug.

    Evidence (App @ bc3e21c)

    Why web works but iOS doesn't: this matches the platform split in the reports — #97945 (this issue) is iOS-only, while the web variant is tracked separately (see below).

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

    Thread the originating expense report into the Concierge message on native, so the same sidePanelContext the web path already sends gets built on native too:

    1. Capture the source report's reportID (and any selected transaction IDs) at the moment Concierge Anywhere is opened in useOpenConciergeAnywhere/index.native.tsx, instead of discarding it.
    2. Have the native composer path build a sidePanelContext ({reportID, selectedTransactionIDs}) from that captured report and pass it into addComment, so Report/index.ts:1029 includes it in the AddComment request. This will require relaxing the isInSidePanel-only guard so native can supply context without a literal side panel.

    Backend already consumes sidePanelContext.reportID / selectedTransactionIDs, so no backend change should be required for the reportID path — worth a quick confirmation that the handler treats a native-originated sidePanelContext identically before implementing.

    What alternative solutions did you explore? (Optional)

    Adopt a native side-panel-equivalent overlay so the existing isInSidePanel plumbing works unchanged — heavier, and a product/design decision rather than a targeted fix.


    Related: #97476 — "Concierge updating category for selected expenses" covers the web side of the same Concierge Anywhere bulk-category feature (currently Reviewing, has a PR in review). Same feature area, different platform/root cause; worth coordinating so the native fix here lands consistently with that work.

    ℹ️ This is an iOS-native-only bug — the web build (the only platform available to me for automated verification) is unaffected, so the analysis is based on code evidence rather than a repro run.


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

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

    @melvin-bot

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

  7. melvin-bot commented on Aug 6, 2026

    @melvin-bot
  8. changed the title [-]iOS app - Update category - Concierge replies "This chat/report does not have expenses"[/-] [+]Update category - Concierge replies "This chat/report does not have expenses"[/+] on Aug 6, 2026
  9. dmkt9 commented on Aug 6, 2026

    @dmkt9
    Contributor

    @MelvinBot create a patch.diff for your proposal

  10. MelvinBot commented on Aug 6, 2026

    @MelvinBot
    Contributor

    Here's a patch.diff implementing the proposal — threading the originating expense report into the Concierge message on native so the backend receives the same sidePanelContext the web side panel already sends.

    What it does (5 files):

    • Capture the report the user was viewing when Concierge Anywhere opens on native, and stash it in a new one-shot Onyx key (useOpenConciergeAnywhere/index.native.tsx).
    • Thread that captured context into the composer's sidePanelContext when composing in the Concierge chat with no side panel present (useSidePanelContext.ts).
    • Relax the isInSidePanel-only guard so a native-supplied context is attached to the AddComment request (Report/index.ts).
    • Clear the context after the message is sent so it can't leak into later, unrelated Concierge messages (useComposerSubmit.ts).
    • New Onyx key + type (ONYXKEYS.ts).

    Web is untouched — it still builds context from the live side-panel state.

    diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts
    index 62f3d93..1246bea 100755
    --- a/src/ONYXKEYS.ts
    +++ b/src/ONYXKEYS.ts
    @@ -721,6 +721,13 @@ const ONYXKEYS = {
         /** The user's Concierge reportID */
         CONCIERGE_REPORT_ID: 'conciergeReportID',
     
    +    /**
    +     * The context (source report / selected transactions) captured when Concierge Anywhere is opened on native.
    +     * On web this lives in the live side-panel state; native has no side panel, so we stash it here and thread it
    +     * into the next Concierge message so Concierge knows which report the user was viewing.
    +     */
    +    CONCIERGE_SOURCE_CONTEXT: 'conciergeSourceContext',
    +
         /** The user's Self DM reportID */
         SELF_DM_REPORT_ID: 'selfDMReportID',
     
    @@ -1757,6 +1764,7 @@ type OnyxValuesMapping = {
         [ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES]: Record<string, string>;
         [ONYXKEYS.CONCIERGE_THINKING_KICKOFF]: boolean;
         [ONYXKEYS.CONCIERGE_REPORT_ID]: string;
    +    [ONYXKEYS.CONCIERGE_SOURCE_CONTEXT]: OnyxTypes.SidePanelContext;
         [ONYXKEYS.SELF_DM_REPORT_ID]: string;
         [ONYXKEYS.SHARE_UNKNOWN_USER_DETAILS]: Participant;
         [ONYXKEYS.SHARE_TEMP_FILE]: OnyxTypes.ShareTempFile;
    diff --git a/src/hooks/useOpenConciergeAnywhere/index.native.tsx b/src/hooks/useOpenConciergeAnywhere/index.native.tsx
    index e7c0dbc..43ca458 100644
    --- a/src/hooks/useOpenConciergeAnywhere/index.native.tsx
    +++ b/src/hooks/useOpenConciergeAnywhere/index.native.tsx
    @@ -1,6 +1,10 @@
    +import Onyx from 'react-native-onyx';
    +
     import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
     import useOnyx from '@hooks/useOnyx';
     
    +import Navigation from '@libs/Navigation/Navigation';
    +
     import {navigateToConciergeChat} from '@userActions/Report';
     
     import ONYXKEYS from '@src/ONYXKEYS';
    @@ -20,6 +24,17 @@ function useOpenConciergeAnywhere() {
     
         // eslint-disable-next-line @typescript-eslint/no-unused-vars
         const openConciergeAnywhere = (_options?: {forceConcierge?: boolean}) => {
    +        // On web the side panel keeps the originating report on screen, so Concierge receives its context
    +        // automatically. Native has no side panel and navigates away to the Concierge chat, which would drop
    +        // the source report. Capture the report the user was viewing here so the next Concierge message can
    +        // thread it back (see useSidePanelContext).
    +        const sourceReportID = Navigation.getTopmostReportId();
    +        if (sourceReportID && sourceReportID !== conciergeReportID) {
    +            Onyx.set(ONYXKEYS.CONCIERGE_SOURCE_CONTEXT, {reportID: sourceReportID});
    +        } else {
    +            Onyx.set(ONYXKEYS.CONCIERGE_SOURCE_CONTEXT, null);
    +        }
    +
             navigateToConciergeChat(conciergeReportID, introSelected, currentUserAccountID, isSelfTourViewed, betas);
         };
     
    diff --git a/src/libs/actions/Report/index.ts b/src/libs/actions/Report/index.ts
    index da9cf10..cbb14e2 100644
    --- a/src/libs/actions/Report/index.ts
    +++ b/src/libs/actions/Report/index.ts
    @@ -1026,7 +1026,9 @@ function addActions({
             }
         }
     
    -    if (isInSidePanel && isConciergeChat && sidePanelContext && commandName === WRITE_COMMANDS.ADD_COMMENT) {
    +    // The side panel is web-only. On native the same context is captured at open time (useOpenConciergeAnywhere)
    +    // and threaded in via sidePanelContext, so gate on the context being present rather than on isInSidePanel.
    +    if (isConciergeChat && sidePanelContext && commandName === WRITE_COMMANDS.ADD_COMMENT) {
             parameters.sidePanelContext = JSON.stringify(sidePanelContext);
         }
     
    diff --git a/src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts b/src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts
    index 531d6ba..5d1fd6d 100644
    --- a/src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts
    +++ b/src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts
    @@ -26,6 +26,7 @@ import CONST from '@src/CONST';
     import ONYXKEYS from '@src/ONYXKEYS';
     import type * as OnyxTypes from '@src/types/onyx';
     
    +import Onyx from 'react-native-onyx';
     import type {OnyxEntry} from 'react-native-onyx';
     
     import {useRoute} from '@react-navigation/native';
    @@ -77,6 +78,14 @@ function useComposerSubmit(reportID: string) {
                 return;
             }
     
    +        // On native the Concierge source context (captured when Concierge Anywhere was opened) is one-shot:
    +        // it applies only to this outgoing message. Clear it after we've captured it into this submit so it
    +        // doesn't leak into later, unrelated Concierge messages. On web the live side panel owns this state,
    +        // so there is nothing to clear.
    +        if (!isInSidePanel && sidePanelContext) {
    +            Onyx.set(ONYXKEYS.CONCIERGE_SOURCE_CONTEXT, null);
    +        }
    +
             // A new user message supersedes any Concierge processing indicator from a prior turn (e.g. a persisted
             // "...is working on your chat" while a human is handling it). Clear it optimistically so it disappears
             // the instant the user sends, instead of lingering until the ProcessAgentZeroRequest job runs; the
    diff --git a/src/pages/inbox/report/ReportActionCompose/useSidePanelContext.ts b/src/pages/inbox/report/ReportActionCompose/useSidePanelContext.ts
    index 0ee9f10..9306993 100644
    --- a/src/pages/inbox/report/ReportActionCompose/useSidePanelContext.ts
    +++ b/src/pages/inbox/report/ReportActionCompose/useSidePanelContext.ts
    @@ -14,15 +14,23 @@ import {useMemo} from 'react';
     function useSidePanelContext(reportID: string): OnyxTypes.SidePanelContext | undefined {
         const isInSidePanel = useIsInSidePanel();
         const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
    +    const [nativeConciergeContext] = useOnyx(ONYXKEYS.CONCIERGE_SOURCE_CONTEXT);
         const {currentReportID, currentRHPReportID} = useCurrentReportIDState();
         const {currentSearchQueryJSON} = useSearchQueryContext();
         const {selectedTransactionIDs, selectedTransactions, selectedReports} = useSearchSelectionContext();
     
         return useMemo(() => {
    -        if (conciergeReportID !== reportID || !isInSidePanel) {
    +        if (conciergeReportID !== reportID) {
                 return undefined;
             }
     
    +        // Native (no side panel): use the source report captured when Concierge Anywhere was opened.
    +        // This mirrors the {reportID} context the side panel builds on web, so Concierge sees the report
    +        // the user was viewing instead of the (empty) Concierge chat.
    +        if (!isInSidePanel) {
    +            return isEmptyObject(nativeConciergeContext) ? undefined : nativeConciergeContext;
    +        }
    +
             const contextReportID = currentRHPReportID ?? currentReportID ?? undefined;
     
             // selectedTransactions (map) is populated from the Search list; selectedTransactionIDs (array)
    @@ -63,7 +71,18 @@ function useSidePanelContext(reportID: string): OnyxTypes.SidePanelContext | und
             }
     
             return {reportID: contextReportID, selectedTransactionIDs: selectedTransactionIDsForContext, selectedReportIDs: selectedReportIDsForContext};
    -    }, [conciergeReportID, reportID, isInSidePanel, currentSearchQueryJSON?.type, currentRHPReportID, currentReportID, selectedTransactionIDs, selectedTransactions, selectedReports]);
    +    }, [
    +        conciergeReportID,
    +        reportID,
    +        isInSidePanel,
    +        nativeConciergeContext,
    +        currentSearchQueryJSON?.type,
    +        currentRHPReportID,
    +        currentReportID,
    +        selectedTransactionIDs,
    +        selectedTransactions,
    +        selectedReports,
    +    ]);
     }
     
     export default useSidePanelContext;
    Notes & caveats before merging
    • Verification requires a native build. This only touches the native path (index.native.tsx) — web is unaffected and can't exercise it, so I couldn't run an automated repro. Needs an iOS/Android build to confirm Concierge now updates the report's transactions.
    • Backend confirmation: the patch sends sidePanelContext = {reportID} on native, which the backend already consumes for the web flow. Worth a quick check that the handler treats a native-originated sidePanelContext.reportID identically before merging (as flagged in the proposal).
    • Scope: this threads the source reportID only — enough for the reported repro ("Update all transactions in this report…"). Selected-transaction context (multi-select) would need those IDs captured at open time too; left out to keep the change minimal.
    • The context is one-shot (set on open, cleared on send) so it can't attach to unrelated Concierge messages sent later.
    • Permalinks to the touched code at 137adcd: useOpenConciergeAnywhere/index.native.tsx, useSidePanelContext.ts:22, Report/index.ts:1029.

    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/97945) to open a draft PR with this patch.
    To refine: @MelvinBot <your feedback>

  11. dmkt9 commented on Aug 10, 2026

    @dmkt9
    Contributor

    @MelvinBot Can we use currentReportID in the useSidePanelContext instead of ONYXKEYS.CONCIERGE_SOURCE_CONTEXT?

  12. MelvinBot commented on Aug 10, 2026

    @MelvinBot
    Contributor

    Short answer: not on native — that's exactly the case this key exists to handle.

    currentReportID tracks whatever report is currently topmost in the navigation stack — it's set from Navigation.getTopmostReportId(state) on every navigation change. On web that works because the side panel overlays Concierge while keeping the source report on screen, so currentReportID/currentRHPReportID still point at the report the user was viewing.

    On native there is no side panel — openConciergeAnywhere calls navigateToConciergeChat and navigates away from the source report into the Concierge chat. By the time the composer runs useSidePanelContext, the topmost report is the Concierge chat itself, so currentReportID resolves to conciergeReportID — the empty chat. Feeding that into contextReportID at useSidePanelContext.ts:26 would just reproduce the original bug ("this chat/report doesn't have any expenses").

    That navigation is why we need to capture the source reportID at open time (before leaving the report) and stash it somewhere that survives the navigation. A local variable/state can't — the composer lives in a different screen. Onyx is the bridge; CONCIERGE_SOURCE_CONTEXT is that one-shot handoff.

    If you'd rather avoid a persisted Onyx key, the alternative is to capture the source id at open time and pass it through in-memory context that spans both screens (e.g. a React context/ref provider high enough in the tree), then read it in useSidePanelContext. That avoids the Onyx round-trip but adds a new provider and still requires clearing it after send. Reusing currentReportID alone won't work on native regardless of approach.

  13. 43 remaining items

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Sep 17, 2026
  15. melvin-bot commented on Sep 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Sep 22, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    Upwork Job

    • Assignee: @dmkt9 requires payment (Needs manual offer from BZ)

    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
  17. mallenexpensify commented on Sep 25, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dmkt9 paid $250 via Upwork

    @dmkt9 can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022103283873378895840

  18. dmkt9 commented on Sep 25, 2026

    @dmkt9
    Contributor

    Contributor+: @dmkt9 due $250 via Upwork

    @mallenexpensify Thanks. I've accepted the offer.

  19. mallenexpensify commented on Sep 25, 2026

    @mallenexpensify
    Contributor

    @dmkt9 paid, summary updated above. Thx.

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 contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions