Skip to content

Commit db015e9

Browse files
committed
Fix DEW routed action marking reports unread
1 parent 6d0c60d commit db015e9

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/libs/ReportActionsUtils.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,13 @@ function shouldHideNewMarker(reportAction: OnyxEntry<ReportAction>, isOffline: b
13601360
if (!reportAction) {
13611361
return true;
13621362
}
1363+
1364+
// The DEW routed action is synthesized client-side on top of its parent SUBMITTED/FORWARDED action
1365+
// and is never persisted, so it carries no unread state of its own for the marker to anchor on.
1366+
if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.DYNAMIC_EXTERNAL_WORKFLOW_ROUTED) {
1367+
return true;
1368+
}
1369+
13631370
return !isOffline && reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
13641371
}
13651372

@@ -1617,7 +1624,11 @@ function getDynamicExternalWorkflowRoutedAction(
16171624
const originalMessage = getOriginalMessage(reportAction);
16181625
return {
16191626
reportActionID: `${reportAction.reportActionID}DEW`,
1620-
created: DateUtils.addMillisecondsFromDateTime(reportAction.created, 1),
1627+
// Reuse the parent action's created so this synthetic action never counts as newer than the
1628+
// read watermark stamped at the parent action's timestamp. getSortedReportActions breaks the
1629+
// created tie by reportActionID, and `${id}DEW` sorts right after `${id}`, so the routed
1630+
// message still renders directly below its parent action.
1631+
created: reportAction.created,
16211632
actionName: CONST.REPORT.ACTIONS.TYPE.DYNAMIC_EXTERNAL_WORKFLOW_ROUTED,
16221633
actorAccountID: CONST.ACCOUNT_ID.CONCIERGE,
16231634
message: [{html: 'DYNAMIC_EXTERNAL_WORKFLOW', type: 'COMMENT', text: ''}],

0 commit comments

Comments
 (0)