[$175] [Auto] - Concierge - Pre-generated Concierge response does not appears while offline
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.34-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/82874198/folder/22315296/83670639/1956441437?sort=%2Bidentifier Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Windows 10/Chrome App Component: Left Hand Navigation (LHN)
Action Performed:
Preconditions: Logged-in user with an active Concierge conversation. (normal account, not using Expensifail) User has sent a question in Concierge: How do I set up QuickBooks? Steps:
- Open the Concierge chat room where follow-up buttons with pre-generated answers are visible
- Disconnect the device from the internet (enable Airplane Mode or disable Wi-Fi/Data)
- Click on one of the suggested follow-up buttons
Expected Result:
- Verify the pre-generated Concierge response appears instantly in the chat thread while still offline
Actual Result:
No response from Concierge
Workaround:
Unknown
Platforms:
- [x] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/14e1dee2-3d80-412c-bb53-2141c1e5376b
Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7308158
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022119878227182546692
- Upwork Job ID: 2119878227182546692
- Last Price Increase: 2026-11-09
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/74317b20f551fe9709a873964cc9fc3f32c9e28c30ad4c4287c19ea5c923ae41
Triggered auto assignment to @Julesssss (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
🤖 Web test steps verification results: ⚠️ partial
The QuickBooks question was submitted, but Concierge returned no answer or suggested follow-ups within 30 seconds, preventing reproduction. Offline verification was also blocked because the supported browser interface cannot disconnect networking.
| Step | Status |
|---|---|
Ask Concierge “How do I set up QuickBooks?”The question was submitted using the provided normal account. |
✅ |
Verify suggested follow-up buttons are visibleNo Concierge answer or suggested follow-ups appeared within 30 seconds. This blocked the reproduction precondition; it does not confirm the reported offline bug.![]() |
❌ |
Disconnect networking and click a follow-upBlocked: no button was available, and the supported browser interface has no offline control. |
⚠️ |
Verify the answer immediately and after at least 10 seconds offlineBlocked: no offline click occurred. |
⚠️ |
Investigate cached responses and identify the causing PRNo causing PR verified; keep DeployBlockerCash. Do not revert a specific PR on the current evidence.The deploy-blocker investigator compared staging 9.5.34-0 against production 9.5.33-1: seven directly relevant follow-up parsing, dispatch, scheduling, and rendering files are identical between releases. An indirect regression remains possible. Leading hypothesis—not confirmed: the visible button lacked a cached answer. The parser accepts questions without responses; when no response exists, the click handler only sends a comment, so it cannot generate a local offline answer. When cached content exists, the handler queues a local response, and the reveal effect has no offline guard. The expected “instant” response also conflicts with an existing four-second delay, although that cannot explain indefinite absence. Next diagnostic: capture the affected message’s cached follow-up content and the existing hasPregeneratedResponse telemetry. If true, inspect pending-response state and reveal logs after four seconds; if false, compare staging/production payloads before assigning ownership. The affected payload was unavailable, so neither missing data nor a rendering regression is confirmed. |
⚠️ |
Asked for a retest on the revert adhoc here https://github.com/Expensify/App/pull/106333
I tried testing this locally on the main branch without pulling the latest changes yet (which doesn't include our PR), and I can reproduce the issue.
https://github.com/user-attachments/assets/28a233ac-f068-4c6b-8ee4-8b7cabd180f1
The latest commit is 63acb1ed08949b77fb80f02e8b2d1d6360d0d90b.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @daledah (External)
Thanks sounds like this si not blocker then
Job added to Upwork: https://www.upwork.com/jobs/~022119878227182546692
Proposal
What is the root cause of that problem?
There are two interacting root causes:
-
Target Report ID Mismatch for Threaded Followups (
resolveSuggestedFollowup): InChatActionableButtons.tsx,SuggestedFollowupButtonsinvokes:resolveSuggestedFollowup( actionOwnerReport, reportID, // passed as notifyReportID action, followup, ... );Where
actionOwnerReportisoriginalReport ?? report. In a Concierge question thread,actionOwnerReportpoints to the parent Concierge DM (originalReport), while the active thread's report ID is passed asreportID(notifyReportID). However, insidesrc/libs/actions/Report/SuggestedFollowup.ts:function resolveSuggestedFollowup( report: OnyxEntry<Report>, notifyReportID: string | undefined, ... ) { const reportID = report?.reportID;reportIDis taken strictly fromreport?.reportID(the parent DM) instead ofnotifyReportID ?? report?.reportID(the active thread). Consequently:buildOptimisticAddCommentReportActionis stamped with the parentreportID.addOptimisticConciergeActionWithDelaywrites to${ONYXKEYS.COLLECTION.PENDING_CONCIERGE_RESPONSE}${actionOwnerReport.reportID}.applyPendingConciergeActioncommits the action to${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${actionOwnerReport.reportID}.
Meanwhile, the user is viewing the thread (
notifyReportID). The thread'sReportActionsSkeletonGuardandusePendingConciergeResponse(reportID)listen to the thread's ID, so the optimistic action is never rendered in the thread. -
Unnecessary 4000ms Delay & Suppressed Typing Indicator While Offline: In
src/libs/actions/Report/SuggestedFollowup.ts,addOptimisticConciergeActionWithDelaysetsdisplayAfter: Date.now() + CONCIERGE_RESPONSE_DELAY_MS(4000ms delay). This delay was introduced for online flows so the server-ownedagentZeroProcessingIndicatorNVP can render "Concierge is thinking...". When offline:- The server NVP is never received.
- Client typing indicators for Concierge are explicitly suppressed in
usePendingConciergeResponse.ts. - The response is already pre-generated and locally available in
selectedFollowup.response. Imposing a 4000ms delay while offline leaves the UI frozen with zero feedback. If the user navigates away or the view unmounts before 4 seconds, the response timer is cancelled and the action is never committed toREPORT_ACTIONS.
(Note: Additionally, if a backend payload provides
<followup-list>containing only<followup-text>without a<followup-response>child node,selectedFollowup.responseisundefined, soresolveSuggestedFollowupcorrectly falls back toaddCommentfor an online server round-trip).
What changes do you think we should make in order to solve the problem?
-
In
src/libs/actions/Report/SuggestedFollowup.ts:- Define
const targetReportID = notifyReportID ?? reportID;. - Route the optimistic Concierge action, delayed queue, and pending action to
targetReportID:const targetReportID = notifyReportID ?? reportID; const isOffline = getIsOffline(); - When offline (
isOfflineis true):- Build
optimisticConciergeActionwithreportID: targetReportIDandcreatedOffset: 1. - Post the user's comment via
addComment. - Immediately invoke
applyPendingConciergeAction(targetReportID, optimisticConciergeAction.reportAction)instead of waiting 4000ms.
- Build
- When online:
- Proceed with normal
addOptimisticConciergeActionWithDelay(targetReportID, optimisticConciergeAction).
- Proceed with normal
- Define
-
In
src/hooks/usePendingConciergeResponse.ts:- When
isOfflineis true and a pending response is detected, immediately commit it viaapplyPendingConciergeAction(reportID, reportAction)instead of scheduling delayed timers or trickle intervals.
- When
// In src/libs/actions/Report/SuggestedFollowup.ts:
const targetReportID = notifyReportID ?? reportID;
const isOffline = getIsOffline();
if (isOffline) {
const optimisticConciergeAction = buildOptimisticAddCommentReportAction({
text: selectedFollowup.response,
actorAccountID: CONST.ACCOUNT_ID.CONCIERGE,
createdOffset: 1,
reportActionID: optimisticConciergeReportActionID,
reportID: targetReportID,
isHTML: true,
currentUserEmail,
currentUserAccountID,
delegateAccountIDParam: delegateAccountID,
});
addComment({
report,
notifyReportID: targetReportID,
ancestors,
text: selectedFollowup.text,
timezoneParam,
currentUserAccountID,
shouldPlaySound: false,
isInSidePanel: false,
pregeneratedResponseParams: {
optimisticConciergeReportActionID,
optimisticConciergeCreated: optimisticConciergeAction.reportAction.created,
pregeneratedResponse: selectedFollowup.response,
},
delegateAccountID,
conciergeReportID,
});
applyPendingConciergeAction(targetReportID, optimisticConciergeAction.reportAction);
} else {
// Standard online path with delay/trickle
addOptimisticConciergeActionWithDelay(targetReportID, optimisticConciergeAction);
}
What alternative solutions did you explore? (Optional)
- Handling offline display only in
usePendingConciergeResponse.ts: While this handles the delay, it does not fix the thread routing mismatch (targetReportID). In threads, the action would still be committed to the parent DM rather than the thread. Fixing both inSuggestedFollowup.tsensures consistent behavior across both root Concierge chats and question threads.
Tests
- Open Concierge and ask a question that returns suggested follow-up buttons with pre-generated answers (test both root Concierge chat and inside a thread).
- Disconnect the device from the internet (Airplane Mode / DevTools offline).
- Click on one of the suggested follow-up buttons.
- Verify that:
- The user's question comment appears immediately.
- The pre-generated Concierge response appears immediately in the chat thread while still offline.
- Reconnect to the internet and verify that report actions sync cleanly with the server without duplicates.
- [x] Verify that no errors appear in the JS console
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@MelvinBot can you make a proposal on this bug?
Proposal — preliminary, not ready for implementation
What is the root cause of that problem?
The cause of the missing response is still unconfirmed. I checked the existing proposal, and its missing-optimistic-flags explanation does not hold:
Verified code findings
- The action builder already sets both
pendingAction: ADDandisOptimisticAction: true: ReportUtils.ts:8055–8061. - Pending actions bypass cached visibility; missing cache entries also fall back to normal visibility evaluation: ReportActionsUtils.ts:1865–1890.
- Cached responses are scheduled locally, and the reveal effect has no offline guard: SuggestedFollowup.ts:89–142, usePendingConciergeResponse.ts:125–154.
A visible follow-up button can lack a cached answer. In that case, the handler only queues the question, so no offline answer is possible. That explains the symptom if the affected payload lacks a response, but we have not established that.
What changes do you think we should make in order to solve the problem?
I would not recommend a code change yet. The next reproduction needs to capture:
- Whether the clicked follow-up has nonempty cached response content (
hasPregeneratedResponse). - If it does, whether the pending response reaches the reveal hook and report-actions list after four seconds.
The existing four-second delay contradicts “instantly,” but removing it alone is not a demonstrated fix for “no response.”
What alternative solutions did you explore? (Optional)
- Re-add optimistic flags: unnecessary; they already exist.
- Change visibility caching: unsupported by the traced code.
- Bypass delay/trickling offline: potentially addresses timing, not the unexplained disappearance.
The two existing targeted test suites passed—all 24 tests—but do not reproduce this failure. Production-log access was unavailable, so the affected payload and reveal events remain the blocker to an implementation-ready proposal.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~013d295f05a578824b
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Concierge chat (specifically inside Concierge question threads or root chats), when a user is offline and clicks on a suggested follow-up button, no response appears from Concierge.
What is the root cause of that problem?
There are two interacting root causes:
-
Target Report ID Mismatch for Threaded Followups (
resolveSuggestedFollowup): InChatActionableButtons.tsx,SuggestedFollowupButtonsinvokes:resolveSuggestedFollowup( actionOwnerReport, reportID, action, followup, ... );Where
actionOwnerReportisoriginalReport ?? report. In a Concierge question thread (e.g. route/r/<threadReportID>/?backTo=%2Fr%2F<conciergeReportID>),actionOwnerReportresolves to the parent Concierge DM (originalReport), while the active thread's report ID is passed asreportID(notifyReportID). However, insidesrc/libs/actions/Report/SuggestedFollowup.ts:function resolveSuggestedFollowup( report: OnyxEntry<Report>, notifyReportID: string | undefined, reportAction: OnyxEntry<ReportAction>, ... ) { const reportID = report?.reportID;reportIDis extracted strictly fromreport?.reportID(actionOwnerReport.reportID, the parent DM) instead ofnotifyReportID ?? report?.reportID(the active thread). Consequently:buildOptimisticAddCommentReportActionis stamped withreportID = actionOwnerReport.reportID.addOptimisticConciergeActionWithDelay(reportID, optimisticConciergeAction)writes to${ONYXKEYS.COLLECTION.PENDING_CONCIERGE_RESPONSE}${actionOwnerReport.reportID}.applyPendingConciergeAction(reportID, reportAction)merges the action into${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${actionOwnerReport.reportID}.
Meanwhile, the user is viewing the thread (
notifyReportID). The thread'sReportActionsSkeletonGuardandusePendingConciergeResponse(reportID)are subscribed to the thread's ID (notifyReportID). They never receive the pending response or the optimistic report action because it was queued and merged under the parent report. -
Unnecessary 4000ms Delay & Suppressed Typing Indicator While Offline:
CONCIERGE_RESPONSE_DELAY_MS = 4000is intended for the online state to delay client display while the server-ownedagentZeroProcessingIndicatorNVP renders "Concierge is thinking...". When offline:- The server NVP is never received.
- Client-side typing status (
REPORT_USER_IS_TYPING) for Concierge is explicitly suppressed inusePendingConciergeResponse.ts. - The pre-generated response is already locally available in
selectedFollowup.response. Enforcing a 4000ms delay while offline leaves the UI frozen with no feedback, and if the user switches away or the component unmounts, the timer is cleared before display.
(Note: In addition, if a backend payload returns
<followup-list>containing only<followup-text>without<followup-response>,selectedFollowup.responseisundefined, soresolveSuggestedFollowuponly posts the question comment viaaddComment; without a pregenerated payload, no offline response is possible).
What changes do you think we should make in order to solve the problem?
-
Target the Active Thread/Report in
src/libs/actions/Report/SuggestedFollowup.ts:- Define
const targetReportID = notifyReportID ?? report?.reportID;. - Use
targetReportIDfor:- Building the optimistic Concierge action (
reportID: targetReportID). - Queueing the delayed response:
addOptimisticConciergeActionWithDelay(targetReportID, optimisticConciergeAction). - Applying the pending action:
applyPendingConciergeAction(targetReportID, reportAction). - Marking the followup-list resolved in
REPORT_ACTIONS:
(Marking the action resolved onOnyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, { [reportActionID]: resolvedAction, });reportIDpreserves the button state on the owning action, while the new reply lands ontargetReportID).
- Building the optimistic Concierge action (
- Define
-
Bypass the 4000ms Delay When Offline:
- In
resolveSuggestedFollowup: IfNetworkStore.isOffline(), setcreatedOffset: 1and immediately invokeapplyPendingConciergeAction(targetReportID, optimisticConciergeAction.reportAction)instead of waiting forCONCIERGE_RESPONSE_DELAY_MS. - In
src/hooks/usePendingConciergeResponse.ts: IfisOfflineis true when a pending response is detected, bypass the delay/trickle and immediately commit it viaapplyPendingConciergeAction(reportID, reportAction).
- In
// In src/libs/actions/Report/SuggestedFollowup.ts:
const targetReportID = notifyReportID ?? reportID;
const isOffline = NetworkStore.isOffline();
if (isOffline) {
const optimisticConciergeAction = buildOptimisticAddCommentReportAction({
text: selectedFollowup.response,
actorAccountID: CONST.ACCOUNT_ID.CONCIERGE,
createdOffset: 1,
reportActionID: optimisticConciergeReportActionID,
reportID: targetReportID,
isHTML: true,
currentUserEmail,
currentUserAccountID,
delegateAccountIDParam: delegateAccountID,
});
addComment({ ... });
applyPendingConciergeAction(targetReportID, optimisticConciergeAction.reportAction);
} else {
// Normal online delayed trickle path
addOptimisticConciergeActionWithDelay(targetReportID, optimisticConciergeAction);
}
What alternative solutions did you explore? (Optional)
- Only removing
CONCIERGE_RESPONSE_DELAY_MSwithout fixingtargetReportID: In Concierge threads, the pre-generated response would still be written to the parent DM'sREPORT_ACTIONSinstead of the active thread, leaving the thread without a response. Fixing both guarantees immediate and correct placement across both root chats and question threads.
Tests
- Navigate to Concierge and ask a question that returns suggested follow-ups with pre-generated responses (e.g., in a thread).
- Disconnect the device from the internet (enable Airplane Mode / offline in DevTools).
- Tap one of the suggested follow-up buttons.
- Verify that:
- The user's question is added to the active thread immediately.
- The pre-generated Concierge response appears immediately in the active thread while still offline.
- Reconnect to the internet and verify that no duplicate messages or errors occur.
— submitted with Antigravity on the contributor's behalf
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@MelvinBot please post a proposal
Proposal — root cause not yet verified
What is the root cause of that problem?
The reported disappearance remains unconfirmed. Further investigation ruled out the proposed general thread-routing mismatch:
- Ordinary thread replies resolve ownership to the thread, not automatically to the parent Concierge DM.
- A focused offline experiment successfully queued the question and displayed its cached answer in that same thread after four seconds.
notifyReportIDcontrols notification, not message destination. Moving only the answer there could separate it from the question and break failure cleanup.
Code evidence
- useOriginalReportID.ts:65–72: thread-owned actions retain thread ownership.
- Report/index.ts:930–965: message destination comes from the supplied report.
- SuggestedFollowup.ts:126–142: cached answers are queued under that report.
- Report/index.ts:1198–1212: failure cleanup targets the same collection.
What changes do you think we should make in order to solve the problem?
No implementation-ready change is justified yet. The remaining specific scenario to reproduce is clicking a follow-up on an ancestor message above the thread’s Replies divider: its answer is queued under the ancestor report, while the mounted thread observes a different pending-response key.
To establish whether that explains this issue, capture the clicked action’s owner report, viewed report, cached response, and pending state after four seconds.
The supplied recordings downloaded, but frame extraction was blocked, so their message placement and timing could not be verified.
What alternative solutions did you explore? (Optional)
Re-adding optimistic flags, retargeting only the answer, and removing the delay do not establish a fix for the reported disappearance. Six focused checks and 27 existing tests passed; none reproduced the affected UI failure.
@daledah,After investigating the network payloads and tracing the flow locally, this appears to be primarily a Backend (BE) issue rather than a frontend bug.
Key Finding:
- Missing Data in the Server Payload: For the question tested ("How do I set up QuickBooks?"), the backend XML returns follow-up suggestions (
<followup-text>), but completely omits<followup-response>. - Precondition Not Met: The test case expects a pre-generated answer to appear while offline. However, because the server never sent a pre-generated answer in the payload, the client has no offline text to display and simply queues the user's question to be answered by the server upon reconnection.
The client cannot display a pre-generated answer offline if the backend never provided one in the response payload.
on my list today