Skip to content

Concierge-After returning to Concierge user lands on unread message but marker is not visible #105438

Open

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.5.26-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #100552
Email or phone of affected tester (no customers): ibellicotest+3215@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11 / Chrome
App Component: Other

Action Performed:

Prerequisite: Concierge chat has chat history.
Prerequisite 2: “Track expenses for my business “ selected during onboarding.

  1. Open the staging.new.expensify.com website.
  2. Navigate to Concierge chat.
  3. Scroll up and mark any message as unread.
  4. Click on "Hide chat history" at the bottom of the chat.
  5. Navigate to a different chat and return to "Concierge"
  6. Note that chat is expanded and you land on unread message, but unread marker is not displayed.

Expected Result:

After returning to Concierge chat, user should be navigated to unread message and unread marker should be visible above it.

Actual Result:

After marking a message as unread and returning to "Concierge", chat is expanded and user lands on unread message, but unread marker is not displayed.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7300030_1793313056757.AI_4.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7300030

Issue OwnerCurrent Issue Owner: @rushatgabhane

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 30, 2026
  2. applause-bot commented on Oct 30, 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/a84295c0740efc8770be5c936ad0aff308aeaf7ba2bef8c2cfbcd9d24d053bfb

  3. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #100552

  4. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    @puneetlath @mkhutornyi you have been assigned to this deploy blocker because you reviewed the offending PR: #100552

  5. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    @rushatgabhane you have been assigned to this deploy blocker because you authored the offending PR: #100552

  6. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  7. github-actions commented on Oct 30, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  8. rushatgabhane commented on Oct 30, 2026

    @rushatgabhane
    Member

    @MelvinBot how to fix this?

  9. rushatgabhane commented on Oct 30, 2026

    @rushatgabhane
    Member

    not blocker worthy

    unless you mark as unread can't be reproduced

  10. MelvinBot commented on Oct 30, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Causing PR: [Payment due @​mkhutornyi] Add ask Concierge screen (merge 0ae60d72), high confidence. It is the only PR in Deploy Checklist: New Expensify 2026-10-29 that touches Concierge or unread-marker code. It added every part of the repro: "Hide chat history," marking the chat read on hide, and auto-expanding history when a message is unread.

    Recommendation: Fix forward and consider demoting. Don't revert. You still land on the right message; only the "New" divider is missing. The flow is narrow and desktop-only, no data is lost, and the feature isn't in production. Reverting a 58-file PR with a backend dependency carries more risk.

    Likely root cause (medium confidence, not reproduced): The PR removed the main Concierge chat's newMessageBoundaryTime. ReportActionsList.tsx:225 now passes undefined unless you're in the side panel (useReportActionsVisibility.ts:63). When history auto-expands on return, the marker logic treats older loaded messages as "just arrived" and skips them. It then moves unreadMarkerTime past the unread message (useUnreadMarker.ts:156-168).

    Suggested fix:

    1. Record a historyExpandedAt time in ConciergeChatHistoryProvider when setShowFullHistory(true) runs. Pass it as newMessageBoundaryTime for the main chat when history is expanded.
    2. In collapseHistory (ConciergeChatHistoryContext.tsx:47-50), call readNewestAction(conciergeReportID, true, true) so the marker state resets.
    3. Add a useUnreadMarker test: unread Concierge message, history loaded after mount, marker stays on that message.
    Investigation details

    Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  11. MelvinBot commented on Oct 30, 2026

    @MelvinBot
    Contributor

    The most likely fix is in useUnreadMarker. When lastReadTime moves backwards, move unreadMarkerTime back with it. Right now the marker time is set once at mount, so it can stay stuck at the "read" time that "Hide chat history" set.

    This corrects my earlier comment. Restoring newMessageBoundaryTime for the main chat probably won't help. In the main chat, the actions are already in the list before the welcome screen returns early, so none of them count as "just arrived."

    Suggested change, right after useUnreadMarker.ts:82:

         const [unreadMarkerTime, setUnreadMarkerTime] = useState(reportLastReadTime);
    +    // lastReadTime moved backwards (marked unread, or the server replaced an optimistic read with an older time).
    +    // Move the watermark back so the unread action can show the New marker.
    +    const [prevReportLastReadTime, setPrevReportLastReadTime] = useState(reportLastReadTime);
    +    if (prevReportLastReadTime !== reportLastReadTime) {
    +        setPrevReportLastReadTime(reportLastReadTime);
    +        if (reportLastReadTime && reportLastReadTime < unreadMarkerTime) {
    +            setUnreadMarkerTime(reportLastReadTime);
    +        }
    +    }

    The change only moves the marker time backwards. Live auto-read and the forward push at useUnreadMarker.ts:166 work as before.

    Fallback: if you'd rather keep the change inside the Concierge code, skip readNewestAction in collapseHistory (ConciergeChatHistoryContext.tsx:47-50) when manuallyMarkedUnreadReportActionID is set. Hiding history then won't overwrite a manual mark-as-unread.

    Why the marker disappears (medium confidence, not reproduced)
    1. "Hide chat history" calls readNewestAction(conciergeReportID, true). This sets Onyx lastReadTime to now but doesn't send the marker-reset event (Report/index.ts:3320-3337).
    2. When you come back, the list mounts and useState(reportLastReadTime) captures that "now" value (useUnreadMarker.ts:82). After that, it only changes through the two events at :89-94 or by moving forward.
    3. lastReadTime then goes back to the older value, which is why the chat counts as unread again. ReportActionsSkeletonGuard.tsx:49-54 expands history and scrolls to the message. But the marker scan compares each message against the stale "now" time, so it finds nothing.
    4. OpenReport clears the manual-unread anchor on a return trip (Report/index.ts:1769-1788), so the timestamp scan is the only way left to show the marker.

    Not confirmed:

    • Why lastReadTime goes back to the older value after hiding. Check the ReadNewestAction request sent on hide and the lastReadTime in the OpenReport response on return. If the server keeps the older time on purpose, use the fallback.
    • Whether the list remounts on return. The bug suggests it does. If it stayed mounted, the old marker time would survive and the marker would show.

    Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this.

  12. puneetlath commented on Oct 30, 2026

    @puneetlath
    Contributor

    Demoting.

  13. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Oct 30, 2026
  14. added
    ReviewingHas a PR in review
    and removed on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions