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
Onboarding - Unread marker reappears on onboarding task after returning online. #97809
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.
Open the Expensify app.
Turn off internet connection.
Navigate to "Workspaces" > Workspace > "Overview"
Make any edition. (For example: Change workspace´s name)
Navigate to Concierge chat.
Open the "Review your workspace settings" task.
Note that "Marked as complete" message, with unread marker appears.
Return to Concierge chat and reopen task.
Note that unread marker disappeared.
Turn on internet connection.
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.
👋 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.
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.
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.tsbuildTaskData (lastReadTime: DateUtils.getDBTime() at L433).
The optimistic TASK_COMPLETED action's created timestamp is minted from the client clock here: ReportUtils.tsbuildOptimisticTaskReportAction (created: getDBTimeWithSkew(Date.now() + createdOffset)).
Root Cause
The unread marker is driven by the report's lastReadTime vs. the newest action's created timestamp.
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.
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.
Activity
applause-bot commentedon Aug 4, 2026
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
melvin-bot commentedon Aug 4, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #95766
melvin-bot commentedon Aug 4, 2026
@robertjchen @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #95766
melvin-bot commentedon Aug 4, 2026
@FitseTLT you have been assigned to this deploy blocker because you authored the offending PR: #95766
melvin-bot commentedon Aug 4, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Aug 4, 2026
👋 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:
FitseTLT commentedon Aug 4, 2026
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.
MelvinBot commentedon Aug 4, 2026
🔍 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.
DeployBlockerCashis kept (an App PR caused the App-deploy-blocking bug). NoDeployBlockerlabel is present, so nothing to remove.📋 Detailed Analysis
Evidence
UPDATE_WORKSPACE_GENERAL_SETTINGS, used by the "change workspace name" repro step) to optimistically add aTASK_COMPLETED("marked as complete") action to the task report, withshouldSendCompleteTaskRequest: false(no separateCompleteTaskrequest — the backend completes the task as a side effect of the settings command).src/libs/actions/Task.tsandsrc/libs/ReportUtils.ts.Verification
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 calluseReviewWorkspaceSettingsTaskCompletion().lastReadTimehere:Task.tsbuildTaskData(lastReadTime: DateUtils.getDBTime()at L433).TASK_COMPLETEDaction'screatedtimestamp is minted from the client clock here:ReportUtils.tsbuildOptimisticTaskReportAction(created: getDBTimeWithSkew(Date.now() + createdOffset)).Root Cause
The unread marker is driven by the report's
lastReadTimevs. the newest action'screatedtimestamp.TASK_COMPLETEDaction getscreated = T0(client time), and the task report'slastReadTimeis set toT0(same moment). Opening the task then re-reads it to ~T0, solastReadTime >= createdand the marker correctly disappears.TASK_COMPLETEDaction. Because it is created at request-processing time, its servercreated = T1 >> T0, and the report'slastVisibleActionCreatedis bumped toT1. The optimistic completion carried nosuccessDatathat re-reads the report and there is no re-read on reconnect, solastReadTimestays atT0. NowlastReadTime (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
lastReadTimeto the offline moment but never reconciles it with the server-assignedcreatedtimestamp once the deferred settings command is confirmed online.Fix options if rolling forward instead of reverting:
lastReadTimeto the confirmed action'screated) so the read state survives the offline→online reconciliation, orcreatedthrough 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.
situchan commentedon Aug 4, 2026
Agree. The root cause should exist in production.
robertjchen commentedon Aug 4, 2026
Ok, proceeding with a revert for now
arosiclair commentedon Aug 4, 2026
@robertjchen can you request a CP for #97815? And then once that's done we'll need to get QA to retest the issue
arosiclair commentedon Aug 4, 2026
Oh nvm I see the request now
arosiclair commentedon Aug 4, 2026
Requested retest here
m-natarajan commentedon Aug 4, 2026
Not repro in Pixel 4/Android13, v9.4.49-2
az_recorder_20260804_171056.mp4