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-07-02] [$250] Concierge notification email received, but corresponding message is hidden in the Concierge chat #93196
Version Number: Reproducible in staging?: Needs Reproduction (Unable to receive email from Concierge for approval) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@shawnborton Slack conversation (hyperlinked to channel name): #Conciergr AI
Action Performed:
Receive a email indicating a new message from Concierge regarding expense approvals.
Login to NewExpensify
Open the Concierge chat.
Review the conversation history.
Expected Result:
The message referenced in the notification should be visible in the Concierge chat so the user can review and act on it.
Actual Result:
The Concierge chat only displays:
"Hi, how can I help?"
The Concierge message is displayed only after clicking the Show full history button
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
This is the Concierge "hidden history" feature collapsing the chat to only the current session (plus the synthetic "Hi, how can I help?" greeting) and hiding everything older behind the Show full history button. The unread message referenced in the email gets caught in that collapse.
The session boundary (sessionStartTime) is decided once when the main Concierge DM mounts, at ReportActionsView.tsx:137-143:
If there is an unread action → the session starts at lastReadTime, so unread messages (created >= lastReadTime) stay visible. ✅
If oldestUnreadReportAction is falsy → the session starts at now, so every message created before this moment is treated as "previous history" and hidden. ❌
The problem is that startSession runs in a useLayoutEffect gated on canStartConciergeSession, which flips true as soon as cached actions exist (ReportActionsView.tsx:135) — before openReport returns and oldestUnreadReportAction resolves. At that instant oldestUnreadReportAction is undefined, so the boundary locks to now. Once the session is set, it is not re-evaluated for ~2h (ConciergeSessionContext.tsx:72-93), so when the unread message finishes loading it is already on the wrong side of the boundary and stays hidden.
Because the user has prior history, hadUserMessageAtSessionStart is true, which triggers the greeting + filtering path in useConciergeSidePanelReportActions.ts:108-165 — exactly the reported symptom: only "Hi, how can I help?" shows, and the real message appears only after Show full history.
Evidence chain & alternative explanations considered
The filter that hides the message: isCurrentSessionAction keeps an action for the main DM only when action.created >= sessionStartTime (useConciergeSidePanelReportActions.ts:134-148). A message created before sessionStartTime=now fails this and is filtered out.
Alternative considered:lastReadTime had already advanced past the message (genuinely "read"), so oldestUnreadReportAction is legitimately null. Same end result (boundary = now, message hidden), but root cause would be read-state handling rather than mount timing. Production logs / a repro would distinguish these.
The startSession effect's deps are [isConciergeMainDM, startSession, canStartConciergeSession] and the oldestUnreadReportAction/lastReadTime values are captured "at mount only" (see the eslint-disable comment at ReportActionsView.tsx:142) — confirming the boundary is not recomputed when the unread action later resolves.
I could not reproduce this myself (the reporter also notes "Needs Reproduction — unable to receive email from Concierge"), so the mount-timing vs. read-state distinction is unconfirmed. Confidence: medium.
What changes do you think we should make in order to solve the problem?
Make the session boundary react to the unread anchor resolving instead of capturing it only at mount:
When the main Concierge DM has an unread message, ensure startSession is (re-)invoked with report?.lastReadTime once oldestUnreadReportAction becomes available — not just on the initial mount when it may still be undefined. This keeps unread messages on the visible side of sessionStartTime.
Alternatively / additionally, when oldestUnreadReportAction is unresolved at mount, defer starting the session until the unread state is known (rather than defaulting the boundary to now), so the boundary isn't locked prematurely.
The fix is entirely within App/src (ReportActionsView.tsx + ConciergeSessionContext.tsx), so it does not require backend changes despite the Internal label — though confirming whether read-state (lastReadTime) is also a factor may need a backend look.
What alternative solutions did you explore? (Optional)
Treating any message newer than lastReadTime as in-session regardless of when the boundary was set — but that overlaps with fix (1) and risks regressing the intended "fresh session" collapse for already-read chats.
Related issues
Same Concierge hidden-history / Show-history cluster — worth cross-checking for shared root cause:
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/93196) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
After receiving an email about a new Concierge message, opening the Concierge chat shows only the synthetic greeting ("Hi, how can I help?"). The actual unread message stays hidden until the user clicks Show full history.
What is the root cause of that problem?
The Concierge main DM hides everything created before the "session start" boundary. That boundary is supposed to be the user's unread cutoff (lastReadTime) so unread messages render immediately. It only does this when an unread anchor exists:
When oldestUnreadReportAction is undefined, startSession falls back to now (ConciergeSessionContext.tsx:83-87). A message created moments earlier then lands before the boundary and is dropped by the session filter — main DM branch action.created >= sessionStartTime in useConciergeSidePanelReportActions.ts:139-141. Clicking Show full history sets showFullHistory=true, which short-circuits the filter at useConciergeSidePanelReportActions.ts:156, so the message reappears. That matches the symptom exactly.
So the bug is that oldestUnreadReportAction is undefined on this flow. Its anchor is computed from a ref snapshot:
useRef(report?.lastReadTime) captures once at the first render. On the reported steps (log in → open Concierge), the Concierge report has not hydrated from disk yet at that first render, so report?.lastReadTime is undefined. The ref latches undefined and never recovers, even after lastReadTime loads (it isn't in the id deps). id permanently returns undefined → oldestUnreadReportAction is permanently undefined → boundary = now → unread message hidden.
This is why it "needs reproduction": it only fires when the report isn't already cached at mount (cold login / notification deep-link). When Concierge is already in memory, lastReadTime is present at first render and the anchor works.
What changes do you think we should make in order to solve the problem?
Latch the first definedlastReadTime, not whatever happens to be present at first render. The codebase already has this exact pattern in src/hooks/useInitial.ts (returns the first non-undefined value).
src/hooks/usePaginatedReportActions.ts:
// import at topimportuseInitialfrom'./useInitial';
The react-hooks/refs eslint-disable comments around lines 50/69 can be removed since we no longer touch .current manually. This keeps the snapshot stable (still captured before openReport marks the report read) while fixing the cold-open case where it was undefined.
changed the title [-]Concierge notification email received, but corresponding message is hidden in the Concierge chat[/-][+][$250] Concierge notification email received, but corresponding message is hidden in the Concierge chat[/+]on Jun 10, 2026
Please re-state the problem that we are trying to solve in this issue.
After getting an email about a new Concierge message, logging in and opening Concierge shows only the synthetic "Hi, how can I help?" greeting. The actual unread message stays hidden until Show full history is clicked.
What is the root cause of that problem?
The Concierge main DM hides everything created before the session boundary, and that boundary is supposed to be the user's unread cutoff (lastReadTime) so unread messages render immediately. When the unread anchor can't be resolved, startSession falls back to now:
So the real question is why the unread anchor is lost on this exact flow. The anchor is derived from report?.lastReadTime, snapshotted at first render:
The email→cold-login flow loses lastReadTime from both ends. On the first render the report isn't cached, so report?.lastReadTime is undefined. And by the time it hydrates, opening the report has already fired readNewestAction, which optimistically merges lastReadTime = now into the report — destroying the unread cutoff:
That's why "capture the first defined lastReadTime" isn't enough on its own: the first defined value the hook can observe is frequently already the post-read now written by readNewestAction. The anchor stays undefined, the boundary locks to now, and the just-arrived message is filtered out — reappearing only when Show full history bypasses the filter. It needs reproduction because a warm cache makes the pre-read lastReadTime available at first render.
What changes do you think we should make in order to solve the problem?
Snapshot the unread cutoff beforereadNewestAction overwrites it. readNewestAction already computes lastReadTime from the report's current value; capture the report's existing lastReadTime at the call sites that mark Concierge read on open (ReportActionsList.tsx:464, ReportFetchHandler.tsx:344) and feed that pre-read value into the Concierge session boundary, rather than re-reading report.lastReadTime after the optimistic merge has landed.
In useConciergeSidePanelReportActions, harden the main-DM filter so a genuinely-unread action is never collapsed even if the boundary resolves late — keep actions newer than the captured pre-session cutoff:
As a complement to (1), usePaginatedReportActions should latch the first definedlastReadTime (via the existing useInitial hook) and add it to the id memo deps, so the anchor recomputes once a non-undefined cutoff first arrives instead of permanently latching undefined.
Together this keeps the unread anchor alive across the cold-open + mark-as-read race, so the message that triggered the email renders without Show full history.
What alternative solutions did you explore? (Optional)
Re-invoking startSession once oldestUnreadReportAction resolves, or deferring the session start until the unread state is known. Both help, but they still read report.lastReadTime after readNewestAction has advanced it on this flow, so the boundary can still lock to now — which is why capturing the cutoff before the read merge (1) is the durable fix rather than only re-timing the session start.
⚠️ @dilshodmackbook-sketch 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.
⚠️@ReaperOAK 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.
Activity
MelvinBot commentedon Jun 10, 2026
Proposal
What is the root cause of that problem?
This is the Concierge "hidden history" feature collapsing the chat to only the current session (plus the synthetic "Hi, how can I help?" greeting) and hiding everything older behind the Show full history button. The unread message referenced in the email gets caught in that collapse.
The session boundary (
sessionStartTime) is decided once when the main Concierge DM mounts, atReportActionsView.tsx:137-143:lastReadTime, so unread messages (created >= lastReadTime) stay visible. ✅oldestUnreadReportActionis falsy → the session starts atnow, so every message created before this moment is treated as "previous history" and hidden. ❌The problem is that
startSessionruns in auseLayoutEffectgated oncanStartConciergeSession, which flips true as soon as cached actions exist (ReportActionsView.tsx:135) — beforeopenReportreturns andoldestUnreadReportActionresolves. At that instantoldestUnreadReportActionisundefined, so the boundary locks tonow. Once the session is set, it is not re-evaluated for ~2h (ConciergeSessionContext.tsx:72-93), so when the unread message finishes loading it is already on the wrong side of the boundary and stays hidden.Because the user has prior history,
hadUserMessageAtSessionStartis true, which triggers the greeting + filtering path inuseConciergeSidePanelReportActions.ts:108-165— exactly the reported symptom: only "Hi, how can I help?" shows, and the real message appears only after Show full history.Evidence chain & alternative explanations considered
isCurrentSessionActionkeeps an action for the main DM only whenaction.created >= sessionStartTime(useConciergeSidePanelReportActions.ts:134-148). A message created beforesessionStartTime=nowfails this and is filtered out.lastReadTimehad already advanced past the message (genuinely "read"), sooldestUnreadReportActionis legitimately null. Same end result (boundary =now, message hidden), but root cause would be read-state handling rather than mount timing. Production logs / a repro would distinguish these.startSessioneffect's deps are[isConciergeMainDM, startSession, canStartConciergeSession]and theoldestUnreadReportAction/lastReadTimevalues are captured "at mount only" (see the eslint-disable comment atReportActionsView.tsx:142) — confirming the boundary is not recomputed when the unread action later resolves.What changes do you think we should make in order to solve the problem?
Make the session boundary react to the unread anchor resolving instead of capturing it only at mount:
startSessionis (re-)invoked withreport?.lastReadTimeonceoldestUnreadReportActionbecomes available — not just on the initial mount when it may still beundefined. This keeps unread messages on the visible side ofsessionStartTime.oldestUnreadReportActionis unresolved at mount, defer starting the session until the unread state is known (rather than defaulting the boundary tonow), so the boundary isn't locked prematurely.The fix is entirely within
App/src(ReportActionsView.tsx+ConciergeSessionContext.tsx), so it does not require backend changes despite theInternallabel — though confirming whether read-state (lastReadTime) is also a factor may need a backend look.What alternative solutions did you explore? (Optional)
Treating any message newer than
lastReadTimeas in-session regardless of when the boundary was set — but that overlaps with fix (1) and risks regressing the intended "fresh session" collapse for already-read chats.Related issues
Same Concierge hidden-history / Show-history cluster — worth cross-checking for shared root cause:
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/93196)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
trasnake87 commentedon Jun 10, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After receiving an email about a new Concierge message, opening the Concierge chat shows only the synthetic greeting ("Hi, how can I help?"). The actual unread message stays hidden until the user clicks Show full history.
What is the root cause of that problem?
The Concierge main DM hides everything created before the "session start" boundary. That boundary is supposed to be the user's unread cutoff (
lastReadTime) so unread messages render immediately. It only does this when an unread anchor exists:src/pages/inbox/report/ReportActionsView.tsx:141When
oldestUnreadReportActionisundefined,startSessionfalls back tonow(ConciergeSessionContext.tsx:83-87). A message created moments earlier then lands before the boundary and is dropped by the session filter — main DM branchaction.created >= sessionStartTimeinuseConciergeSidePanelReportActions.ts:139-141. Clicking Show full history setsshowFullHistory=true, which short-circuits the filter atuseConciergeSidePanelReportActions.ts:156, so the message reappears. That matches the symptom exactly.So the bug is that
oldestUnreadReportActionisundefinedon this flow. Its anchor is computed from a ref snapshot:src/hooks/usePaginatedReportActions.ts:47src/hooks/usePaginatedReportActions.ts:63-68useRef(report?.lastReadTime)captures once at the first render. On the reported steps (log in → open Concierge), the Concierge report has not hydrated from disk yet at that first render, soreport?.lastReadTimeisundefined. The ref latchesundefinedand never recovers, even afterlastReadTimeloads (it isn't in theiddeps).idpermanently returnsundefined→oldestUnreadReportActionis permanentlyundefined→ boundary =now→ unread message hidden.This is why it "needs reproduction": it only fires when the report isn't already cached at mount (cold login / notification deep-link). When Concierge is already in memory,
lastReadTimeis present at first render and the anchor works.What changes do you think we should make in order to solve the problem?
Latch the first defined
lastReadTime, not whatever happens to be present at first render. The codebase already has this exact pattern insrc/hooks/useInitial.ts(returns the first non-undefined value).src/hooks/usePaginatedReportActions.ts:Replace line 47:
Update the consumer (lines 63, 70) to read the value directly and add it to the
idmemo deps so the anchor recomputes oncelastReadTimefirst arrives:The
react-hooks/refseslint-disable comments around lines 50/69 can be removed since we no longer touch.currentmanually. This keeps the snapshot stable (still captured beforeopenReportmarks the report read) while fixing the cold-open case where it wasundefined.melvin-bot commentedon Jun 10, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @QichenZhu (
External)[-]Concierge notification email received, but corresponding message is hidden in the Concierge chat[/-][+][$250] Concierge notification email received, but corresponding message is hidden in the Concierge chat[/+]melvin-bot commentedon Jun 10, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022064760379422384270
David-2002065 commentedon Jun 10, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After getting an email about a new Concierge message, logging in and opening Concierge shows only the synthetic "Hi, how can I help?" greeting. The actual unread message stays hidden until Show full history is clicked.
What is the root cause of that problem?
The Concierge main DM hides everything created before the session boundary, and that boundary is supposed to be the user's unread cutoff (
lastReadTime) so unread messages render immediately. When the unread anchor can't be resolved,startSessionfalls back tonow:App/src/pages/inbox/ConciergeSessionContext.tsx
Lines 83 to 87 in 1a8ff38
A message created moments earlier then lands before the boundary and is dropped by the main-DM filter (
action.created >= sessionStartTime):App/src/hooks/useConciergeSidePanelReportActions.ts
Lines 139 to 140 in 1a8ff38
So the real question is why the unread anchor is lost on this exact flow. The anchor is derived from
report?.lastReadTime, snapshotted at first render:App/src/hooks/usePaginatedReportActions.ts
Lines 47 to 68 in 1a8ff38
The email→cold-login flow loses
lastReadTimefrom both ends. On the first render the report isn't cached, soreport?.lastReadTimeisundefined. And by the time it hydrates, opening the report has already firedreadNewestAction, which optimistically mergeslastReadTime = nowinto the report — destroying the unread cutoff:App/src/libs/actions/Report/index.ts
Lines 2724 to 2734 in 1a8ff38
App/src/pages/inbox/report/ReportActionsList.tsx
Line 464 in 1a8ff38
That's why "capture the first defined
lastReadTime" isn't enough on its own: the first defined value the hook can observe is frequently already the post-readnowwritten byreadNewestAction. The anchor staysundefined, the boundary locks tonow, and the just-arrived message is filtered out — reappearing only when Show full history bypasses the filter. It needs reproduction because a warm cache makes the pre-readlastReadTimeavailable at first render.What changes do you think we should make in order to solve the problem?
Snapshot the unread cutoff before
readNewestActionoverwrites it.readNewestActionalready computeslastReadTimefrom the report's current value; capture the report's existinglastReadTimeat the call sites that mark Concierge read on open (ReportActionsList.tsx:464,ReportFetchHandler.tsx:344) and feed that pre-read value into the Concierge session boundary, rather than re-readingreport.lastReadTimeafter the optimistic merge has landed.In
useConciergeSidePanelReportActions, harden the main-DM filter so a genuinely-unread action is never collapsed even if the boundary resolves late — keep actions newer than the captured pre-session cutoff:if (isConciergeMainDM) { - return isCreatedAction(action) || action.created >= sessionStartTime; + return isCreatedAction(action) || action.created >= sessionStartTime || (!!preSessionLastReadTime && action.created > preSessionLastReadTime); }usePaginatedReportActionsshould latch the first definedlastReadTime(via the existinguseInitialhook) and add it to theidmemo deps, so the anchor recomputes once a non-undefinedcutoff first arrives instead of permanently latchingundefined.Together this keeps the unread anchor alive across the cold-open + mark-as-read race, so the message that triggered the email renders without Show full history.
What alternative solutions did you explore? (Optional)
Re-invoking
startSessiononceoldestUnreadReportActionresolves, or deferring the session start until the unread state is known. Both help, but they still readreport.lastReadTimeafterreadNewestActionhas advanced it on this flow, so the boundary can still lock tonow— which is why capturing the cutoff before the read merge (1) is the durable fix rather than only re-timing the session start.ReaperOAK commentedon Jun 10, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Jun 10, 2026
github-actions commentedon Jun 10, 2026
63 remaining items
melvin-bot commentedon Jul 1, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 1, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jul 3, 2026
Payment Summary
Contributor+: @Krishna2323 due $250 via NewDot
^ Test case created. Thx
laurenreidexpensify commentedon Jul 6, 2026
$250 approved for @Krishna2323