Skip to content

Onboarding - Unread marker reappears on onboarding task after returning online. #97809

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.49-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: #95766
Email or phone of affected tester (no customers): ibellicotest+2766@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app)
App Component: Workspace Settings

Action Performed:

Prerequisite: Sign in with a new account invited to a workspace as an admin so the "Review your workspace settings" task exists in the onboarding/Concierge chat.

  1. Open the Expensify app.
  2. Turn off internet connection.
  3. Navigate to "Workspaces" > Workspace > "Overview"
  4. Make any edition. (For example: Change workspace´s name)
  5. Navigate to Concierge chat.
  6. Open the "Review your workspace settings" task.
  7. Note that "Marked as complete" message, with unread marker appears.
  8. Return to Concierge chat and reopen task.
  9. Note that unread marker disappeared.
  10. Turn on internet connection.
  11. Note that unread marked reappears, despite message being already read.

Expected Result:

Unread marker shouldn´t reappear for read messages when returning online.

Actual Result:

Unread marker on "Marked as complete" message on "Review your workspace settings" task, reappears when user completes task offline and returns online.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7225615_1785852432243.Onboard_6.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7225615

Activity

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

  3. melvin-bot commented on Aug 4, 2026

    @melvin-bot

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

  4. melvin-bot commented on Aug 4, 2026

    @melvin-bot

    @robertjchen @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #95766

  5. melvin-bot commented on Aug 4, 2026

    @melvin-bot

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

  6. melvin-bot commented on Aug 4, 2026

    @melvin-bot

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

  7. github-actions commented on Aug 4, 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. FitseTLT commented on Aug 4, 2026

    @FitseTLT
    Contributor

    I did see the unread marker behavior was weird but thought as out of scope because we are using the existing mechanism to complete the task no specific logic was modified regarding unread marker. I think this is an independent issue.

  9. MelvinBot commented on Aug 4, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #95766 - "Part 1 - Fix review workspace settings onboarding task completion" by @FitseTLT (High confidence)
    Related Issues: #67648 (the issue #95766 was fixing)

    Recommendation: REVERT

    This is a self-contained "Part 1" feature that newly introduced optimistic completion of the "Review your workspace settings" task; reverting it cleanly restores production behavior (where this marker bug does not occur). A targeted roll-forward fix is viable if the team prefers to keep the feature (see Root Cause).

    Assigned: @FitseTLT (PR author), @robertjchen and @situchan (approving reviewers) — already assigned to this issue by Melvin-bot.
    Labels: No changes. DeployBlockerCash is kept (an App PR caused the App-deploy-blocking bug). No DeployBlocker label is present, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • The repro is specific to the "Review your workspace settings" onboarding task being completed as a side effect of editing a workspace setting while offline. That optimistic completion flow was introduced by Part 1 - Fix review workspace settings onboarding task completion #95766 and does not exist in production, which matches the issue's "Reproducible in production?: No".
    • Part 1 - Fix review workspace settings onboarding task completion #95766 wires 10 workspace-settings write commands (e.g. UPDATE_WORKSPACE_GENERAL_SETTINGS, used by the "change workspace name" repro step) to optimistically add a TASK_COMPLETED ("marked as complete") action to the task report, with shouldSendCompleteTaskRequest: false (no separate CompleteTask request — the backend completes the task as a side effect of the settings command).
    • The affected files are exactly the ones the bug lives in: src/libs/actions/Task.ts and src/libs/ReportUtils.ts.
    • The PR author already noted the "unread marker behavior was weird" during development, consistent with this PR being the origin.

    Verification

    • Affected files touched by the PR: src/libs/actions/Task.ts (+83), src/libs/ReportUtils.ts (+12), src/libs/actions/Policy/Policy.ts (+91), plus the 10 workspace-settings pages that now call useReviewWorkspaceSettingsTaskCompletion().
    • The optimistic task-report update sets lastReadTime here: Task.ts buildTaskData (lastReadTime: DateUtils.getDBTime() at L433).
    • The optimistic TASK_COMPLETED action's created timestamp is minted from the client clock here: ReportUtils.ts buildOptimisticTaskReportAction (created: getDBTimeWithSkew(Date.now() + createdOffset)).

    Root Cause

    The unread marker is driven by the report's lastReadTime vs. the newest action's created timestamp.

    1. Offline (steps 4–9): editing a setting queues the settings command and merges the optimistic completion. The optimistic TASK_COMPLETED action gets created = T0 (client time), and the task report's lastReadTime is set to T0 (same moment). Opening the task then re-reads it to ~T0, so lastReadTime >= created and the marker correctly disappears.
    2. Reconnect (steps 10–11): the queued settings command is finally sent. The backend completes the task and returns the real TASK_COMPLETED action. Because it is created at request-processing time, its server created = T1 >> T0, and the report's lastVisibleActionCreated is bumped to T1. The optimistic completion carried no successData that re-reads the report and there is no re-read on reconnect, so lastReadTime stays at T0. Now lastReadTime (T0) < newest created (T1), so the already-read "marked as complete" message renders as unread again — the reported regression.

    In short: the optimistic flow pins lastReadTime to the offline moment but never reconciles it with the server-assigned created timestamp once the deferred settings command is confirmed online.

    Fix options if rolling forward instead of reverting:

    • After the deferred settings command succeeds, re-read the task report (e.g. mark it read / bump lastReadTime to the confirmed action's created) so the read state survives the offline→online reconciliation, or
    • Have the completion carry the client created through so the backend reuses the optimistic timestamp rather than minting a new one.

    Given the subtlety of the offline-sync timing and that this is a fresh, self-contained feature, REVERT is the lower-risk action for unblocking the deploy; a targeted read-state fix can land in a follow-up.

  10. situchan commented on Aug 4, 2026

    @situchan
    Contributor

    Agree. The root cause should exist in production.

  11. robertjchen commented on Aug 4, 2026

    @robertjchen
    Contributor

    Ok, proceeding with a revert for now

  12. arosiclair commented on Aug 4, 2026

    @arosiclair
    Contributor

    @robertjchen can you request a CP for #97815? And then once that's done we'll need to get QA to retest the issue

  13. arosiclair commented on Aug 4, 2026

    @arosiclair
    Contributor

    Oh nvm I see the request now

  14. arosiclair commented on Aug 4, 2026

    @arosiclair
    Contributor

    Requested retest here

  15. m-natarajan commented on Aug 4, 2026

    @m-natarajan

    Not repro in Pixel 4/Android13, v9.4.49-2

    az_recorder_20260804_171056.mp4
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.DailyKSv2EngineeringReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions