From 036edad31d1f0abb9e19f6314a0d529aab3de5af Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Mon, 23 Feb 2026 18:00:09 -0800 Subject: [PATCH 1/4] Only show optimistic DEW error next step to submitter on open reports --- src/components/MoneyReportHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index d5bf29943fb4d..40e0d3d162a46 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -532,7 +532,7 @@ function MoneyReportHeader({ }, {}); const {errors} = getAllReportActionsErrorsAndReportActionThatRequiresAttention(moneyRequestReport, reportActionsObject); - if (errors?.dewSubmitFailed) { + if (errors?.dewSubmitFailed && isReportOwner(moneyRequestReport)) { optimisticNextStep = buildOptimisticNextStepForDynamicExternalWorkflowSubmitError(theme.danger); } else if (isOffline && hasPendingDEWSubmit(reportMetadata, isDEWPolicy)) { optimisticNextStep = buildOptimisticNextStepForDEWOffline(); From a3c0f2dd49da5f200421bc18506e23e443d8396c Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Mon, 23 Feb 2026 18:51:41 -0800 Subject: [PATCH 2/4] Don't show RBR for submit error to admins --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 0de973a4bc60d..b5cb0796a6a79 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -9188,7 +9188,7 @@ function getAllReportActionsErrorsAndReportActionThatRequiresAttention( reportAction = getReportActionWithSmartscanError(reportActionsArray, report); } - if (!isReportArchived && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN) { + if (!isReportArchived && isReportOwner(report) && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN) { const mostRecentActiveDEWAction = getMostRecentActiveDEWSubmitFailedAction(reportActionsArray); if (mostRecentActiveDEWAction) { reportActionErrors.dewSubmitFailed = getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericCreateFailureMessage'); From 8a04d66f7fea06b821d1d6e25c1a4a98941cc85a Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Mon, 23 Feb 2026 19:12:35 -0800 Subject: [PATCH 3/4] Fix broken test, add one more test for non-owner --- tests/unit/ReportUtilsTest.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/unit/ReportUtilsTest.ts b/tests/unit/ReportUtilsTest.ts index 4f287a8d154bd..34ffa23792da0 100644 --- a/tests/unit/ReportUtilsTest.ts +++ b/tests/unit/ReportUtilsTest.ts @@ -11841,6 +11841,7 @@ describe('ReportUtils', () => { it('should return error for DEW_SUBMIT_FAILED action on OPEN report', () => { const report = { reportID: '1', + ownerAccountID: currentUserAccountID, statusNum: CONST.REPORT.STATUS_NUM.OPEN, stateNum: CONST.REPORT.STATE_NUM.OPEN, }; @@ -11872,6 +11873,34 @@ describe('ReportUtils', () => { expect(reportAction).toEqual(dewSubmitFailedAction); }); + it('should NOT return error for DEW_SUBMIT_FAILED when current user is not the report owner', () => { + const report = { + reportID: '1', + ownerAccountID: 999, + statusNum: CONST.REPORT.STATUS_NUM.OPEN, + stateNum: CONST.REPORT.STATE_NUM.OPEN, + }; + + const dewSubmitFailedAction = { + ...createRandomReportAction(1), + reportActionID: '1', + actionName: CONST.REPORT.ACTIONS.TYPE.DEW_SUBMIT_FAILED, + created: '2025-11-21 12:00:00', + shouldShow: true, + originalMessage: { + message: 'Error message', + }, + }; + + const reportActions = { + [dewSubmitFailedAction.reportActionID]: dewSubmitFailedAction, + }; + + const {errors} = getAllReportActionsErrorsAndReportActionThatRequiresAttention(report, reportActions); + + expect(errors?.dewSubmitFailed).toBeUndefined(); + }); + it('should NOT return error for DEW_SUBMIT_FAILED if there is a more recent SUBMITTED action', () => { const report = { reportID: '1', @@ -11910,6 +11939,7 @@ describe('ReportUtils', () => { it('should return error for DEW_SUBMIT_FAILED if it is more recent than SUBMITTED action', () => { const report = { reportID: '1', + ownerAccountID: currentUserAccountID, statusNum: CONST.REPORT.STATUS_NUM.OPEN, stateNum: CONST.REPORT.STATE_NUM.OPEN, }; From 1d1269f8cc13f0947837dd4fce65b02beb3f983f Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Tue, 24 Feb 2026 10:40:48 -0800 Subject: [PATCH 4/4] Remove redundant `isReportOwner` check --- src/components/MoneyReportHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 40e0d3d162a46..d5bf29943fb4d 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -532,7 +532,7 @@ function MoneyReportHeader({ }, {}); const {errors} = getAllReportActionsErrorsAndReportActionThatRequiresAttention(moneyRequestReport, reportActionsObject); - if (errors?.dewSubmitFailed && isReportOwner(moneyRequestReport)) { + if (errors?.dewSubmitFailed) { optimisticNextStep = buildOptimisticNextStepForDynamicExternalWorkflowSubmitError(theme.danger); } else if (isOffline && hasPendingDEWSubmit(reportMetadata, isDEWPolicy)) { optimisticNextStep = buildOptimisticNextStepForDEWOffline();