Fix Concierge hidden-history hiding unread notification message on cold open#93711
Fix Concierge hidden-history hiding unread notification message on cold open#93711MelvinBot wants to merge 3 commits into
Conversation
On cold open, startSession runs before oldestUnreadReportAction resolves, locking sessionStartTime to `now` and hiding the notification message behind "Show full history". Re-invoke startSession when the unread anchor resolves and allow ConciergeSessionContext to pull sessionStartTime back to an earlier boundary within an active session. Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Please extend the fix to cover:
@MelvinBot please investigate these scenarios and apply if valid. |
… return Use useInitial(report?.lastReadTime) so the unread anchor resolves when the report loads after first render, and add oldestUnreadReportAction?.created to the native focus-return effect deps so the boundary pulls back when the anchor arrives after returning to the chat. Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Investigated all four scenarios. Applied 2 of them; the other 2 were either redundant or reintroduce a hazard this PR deliberately avoids. Pushed in 7c6fb2c. ✅ #2 — This was a real cold-login bug. The old ✅ #3 — add Done at ❌ #1 — fallback to This reintroduces the exact hazard the PR was built to avoid. ❌ #4 — capture open-time unread state before This is already how the architecture works: Verification: |
Explanation of Change
The Concierge main DM collapses everything created before
sessionStartTimebehind Show full history. On a cold open (e.g. opening Concierge from an approval-notification email),startSessionruns as soon as cached actions exist — beforeoldestUnreadReportActionresolves. At that instant the unread anchor isundefined, so the boundary locks tonowand the unread notification message, created moments earlier, ends up on the hidden side of the boundary. The user only sees "Hi, how can I help?" until they click Show full history.The C+ reviewer verified that re-invoking
startSessionalone is insufficient:ConciergeSessionContextkeepsprevfor the duration of an active session, so a secondstartSessioncall is a no-op. This PR fixes both halves:ReportActionsView.tsx— the session-start effect now re-runs whenoldestUnreadReportActionresolves (addedoldestUnreadReportAction?.createdto its deps), and passes that action'screatedtime as the boundary.oldestUnreadReportAction.createdis derived from the pre-readlastReadTimesnapshot inusePaginatedReportActions, so it is immune to thereadNewestActionoptimistic bump of the livereport.lastReadTimetonow. It yields the same visible set as the intended pre-read boundary (nothing exists betweenlastReadTimeand the oldest unread action by definition).ConciergeSessionContext.tsx— within an active (non-expired) session,startSessionnow pullssessionStartTimeback to an earlierunreadBoundarywhen one arrives, instead of unconditionally returningprev. The session age (sessionCreatedAtRef) is left unchanged — only the display boundary is refined. When the boundary moves back, downstreamuseConciergeSidePanelReportActionsrecomputeshadMessagesAtSessionStart(it keys offsessionStartTimechanging), so the unread message renders and the greeting-only collapse is suppressed.When there is no unread action, the boundary still defaults to
now, preserving the intended fresh-session collapse for already-read chats.Fixed Issues
$ #93196
PROPOSAL: #93196 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
Offline tests
N/A
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari