Repository navigation
Show report submit errors in the Search row and make them dismissible in the report - #103547
Conversation
…ible in the report - Stop showing report errors as a separate RBR under Search report rows - Add 'Report failed to submit because of errors.' to the row message - Show report.errors in the report view and add clearReportErrors to dismiss them - Clear report.errors optimistically when submitting again Co-authored-by: nkdengineer <nkdengineer@users.noreply.github.com>
|
I created this PR from an upstream branch because I can't push to your fork. To take over this branch and push updates, run: Then you can close this PR and open a new one from your fork. |
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
| descriptionMessages.push(translate('reportViolations.reportContainsExpensesWithViolations')); | ||
| } | ||
| if (hasReportErrors) { | ||
| descriptionMessages.push(translate('reportViolations.reportFailedToSubmit')); |
There was a problem hiding this comment.
@MelvinBot Let's update this with a more generic sentence like Report has errors instead of a special error for all cases.
Co-authored-by: nkdengineer <nkdengineer@users.noreply.github.com>
|
Done. The Search report row now shows the generic sentence "Report has errors." instead of "Report failed to submit because of errors." It still follows "Report contains expenses with violations." when both apply. This also settles the open question from the description: failed pay, approve, and export actions no longer say "failed to submit". What changed
I couldn't run typecheck or lint locally in this run. A search confirms no references to the old key remain, and CI will run the full checks. |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/it.ts b/src/languages/it.ts
index 0ca7c309..46fd2ec5 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -11011,7 +11011,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
reportViolations: {
[CONST.REPORT_VIOLATIONS.FIELD_REQUIRED]: (fieldName: string) => `${fieldName} è obbligatorio`,
reportContainsExpensesWithViolations: 'Il report contiene spese con violazioni.',
- reportHasErrors: 'Il report contiene errori.',
+ reportHasErrors: 'Il report contiene degli errori.',
},
violationDismissal: {
rter: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 555701ef..259f6afa 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -10973,7 +10973,7 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
reportViolations: {
[CONST.REPORT_VIOLATIONS.FIELD_REQUIRED]: (fieldName: string) => `${fieldName} é obrigatório`,
reportContainsExpensesWithViolations: 'O relatório contém despesas com violações.',
- reportHasErrors: 'O relatório contém erros.',
+ reportHasErrors: 'O relatório tem erros.',
},
violationDismissal: {
rter: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 7e9d711e..c90d34e3 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -10573,7 +10573,7 @@ ${reportName}`,
reportViolations: {
[CONST.REPORT_VIOLATIONS.FIELD_REQUIRED]: (fieldName: string) => `${fieldName} 为必填项`,
reportContainsExpensesWithViolations: '报表包含有违规的报销。',
- reportHasErrors: '报表有错误。',
+ reportHasErrors: '报表存在错误。',
},
violationDismissal: {
rter: {
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
@MelvinBot Update translation based on this |
Co-authored-by: nkdengineer <nkdengineer@users.noreply.github.com>
|
I applied the translation updates from the Polyglot Parrot comment in d1e3667.
No other lines changed. |
|
@MelvinBot, fill out the Test section Precondition: Have a
Then update |
|
I updated the PR description:
|
|
@MelvinBot, fill the Screenshots/VideosAndroid: NativeScreen.Recording.2026-10-14.at.16.29.31.movAndroid: mWeb ChromeScreen.Recording.2026-10-14.at.16.26.18.moviOS: NativeScreen.Recording.2026-10-14.at.17.06.27.moviOS: mWeb SafariScreen.Recording.2026-10-14.at.16.25.26.movMacOS: Chrome / SafariScreen.Recording.2026-10-14.at.16.23.32.mov |
|
I filled out the |
|
@MelvinBot, Update the Author Checklist section. Also, I verified there's no console error; then let's check for PR Author Checklist
|
|
Done. I updated the PR description and marked the PR ready for review.
|
|
@nkdengineer Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I resolved the merge conflict with The only conflict was in TypeScript reports no errors in the files this PR changes. |
|
@mountiny All yours. |
mountiny
left a comment
There was a problem hiding this comment.
(Vit's agent) Requesting changes for one regression in the Search row. Details are in the inline comment.
Blocker
- After a failed resubmit, a rejected report shows no error in the Search row. See the inline comment on
ExpenseReportListItem.tsx.
Needs a product call (not blocking from me)
- For a DEW failure, the report now shows the same message twice: once in the
DEWSUBMITFAILEDsystem message, and once in the new error row at the bottom. The backend puts the DEW message itself intoreport.errors. On the native apps, the row text also starts with "Report cannot be submitted: ". - trjExpensify asked why DEW needs another dismissible error (comment). The later agreement on bottom placement covered "general" API errors (comment). The test steps here use DEW, so please confirm that DEW failures should also show the bottom row.
Nice to have
MoneyRequestReportViewkeeps the single-transaction guard on line 142. When the transaction in a one-expense report has errors, that guard dropsreport.errors. The Search row then says "Report has errors." with nothing to dismiss in the Search side panel. This is the case from the second Codex comment.- The PR description still says "Not verified in the UI", but the videos are attached now.
Checked and fine
- The local dismiss in
clearReportErrorsis enough. The backend sendsreport.errorsonly in the failed API response and never stores it, so the error does not come back on the nextOpenReport. - The optimistic
errors: nullinsubmitReportandsubmitMoneyRequestOnSearchmatches the shape of the existing failure data.
| const hasReportErrors = !isEmptyObject(parentReport ? parentReport.errors : item.errors); | ||
|
|
||
| let getDescription; | ||
| if (reportItem?.isRejectedReport) { |
There was a problem hiding this comment.
(Vit's agent) Blocker: after a failed resubmit, a rejected report shows no error in this row.
- This branch runs before the new
hasReportErrorscheck, so "Report has errors." is never added. - Line 433 strips
errorsfrom every item, so the separate error line is gone too.
This case does happen. The backend keeps the rejected next step until a submit action is newer than the rejection. A failed submit does not add one, and the DEW failed submit action does not count. On the client, the submitReport failure data restores the old nextStep, and submitMoneyRequestOnSearch never changes it. So isRejectedReport stays true.
On main, the todo searches (Submit, Approve, Pay, Export) still show the separate error line for this row, because those rows use the live report. So this is a regression there. The first Codex comment flagged it. The reply says the row now shows the general message, but that is not true for this branch.
Suggested fix: build the message list once, so a rejected report can also show "Report has errors.". This also removes the duplicated View/Icon/Text block.
const descriptionMessages: string[] = [];
if (reportItem?.isRejectedReport) {
descriptionMessages.push(translate('iou.rejectReport.rejectedReportMessage'));
} else if (shouldShowViolationsMessage) {
descriptionMessages.push(translate('reportViolations.reportContainsExpensesWithViolations'));
}
if (hasReportErrors) {
descriptionMessages.push(translate('reportViolations.reportHasErrors'));
}Then render the existing row once when descriptionMessages.length > 0, with {descriptionMessages.join(' ')} as the text.
There was a problem hiding this comment.
Updated in 617c0f3.
The row now builds one message list. A rejected report with errors shows "This report was rejected. Report has errors." The rejected and violations messages still don't appear together. The duplicated View/Icon/Text block is gone.
Typecheck, ESLint (no new violations), the React Compiler check, and the related Search Jest tests pass. I didn't test it in the UI.
|
@MelvinBot Please update this |
Co-authored-by: nkdengineer <nkdengineer@users.noreply.github.com>
|
MelvinBot has made 7 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
Co-authored-by: nkdengineer <nkdengineer@users.noreply.github.com>
|
@mountiny I updated. |
mountiny
left a comment
There was a problem hiding this comment.
Thanks! lets give it a go
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@nkdengineer @mountiny @MelvinBot Can we use expensifail account for testing this? applausetester+rg_46@applause.expensifail.com
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.31-0 🚀
|
|
No help site update needed — this PR fixes report error display and dismissal without adding a new workflow or making an existing article incorrect. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.31-0 🚀
|
|
@MelvinBot Can we use expensifail account for testing this? applausetester+rg_46@applause.expensifail.com
|
|
You can use that account if it belongs to a workspace configured for DEW with the I haven’t verified that account’s workspace configuration. Ask |
|
@izarutskaya I think @mountiny or @trjExpensify can help to config |
|
We have few accounts with DEW, but I am not sure if we have correct workspace in some of these: applausetester+rg_46@applause.expensifail.com Also just in case created new account - applausetester+dews@applause.expensifail.com |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀
Bundle Size Analysis (Sentry): |
|
@izarutskaya I've put the |
|
Thanks! |





Explanation of Change
When a report failed to submit, Search showed
report.errorsas a separate red-dot line under the report row. It was unclear which report the error belonged to, and the X on it did nothing. The report itself never showedreport.errors.This PR changes that:
ExpenseReportListItemnow passes the item to the shared row withouterrors, so no separate error line appears. When the report has errors, the row message adds "Report has errors." It is joined with "Report contains expenses with violations." when both apply. The sentence is generic, so it fits any action that writes toreport.errors(submit, pay, approve, export). The row reads live Onyx errors first, so the sentence goes away after the error is dismissed in the report.MoneyRequestReportViewandReportScreenfall back toreport.errorswhen there are no report-creation errors. Dismissing that error calls the newclearReportErrors(reportID)action and keeps you on the report. Report-creation errors still go back and remove the failed report, as before.submitMoneyRequestOnSearchandsubmitReportnow clearreport.errorsin their optimistic data, so an old error doesn't stay after a successful retry.reportViolations.reportHasErrorsto every locale. The non-English strings are my own translations, so please check them.Unit tests cover the optimistic error reset for both submit paths.
Not verified in the UI: the automated web test couldn't start because the test browser session loaded a blank page. The Search report row, report view, and report screen changes still need a manual check.
The Merge reports page has the same separate error line (Spend - Error message appears below report row on Merge reports and cannot be dismissed). I left it out because an open PR already changes that page.
Fixed Issues
$ #103444
PROPOSAL: #103444 (comment)
Tests
Precondition: Have a
DEWworkspace and addGENERIC_NON_REIMBURSABLE_CASHprocessorGENERIC_NON_REIMBURSABLE_CASHreportReport has errorstextOffline tests
Same as test
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-10-14.at.16.29.31.mov
Android: mWeb Chrome
Screen.Recording.2026-10-14.at.16.26.18.mov
iOS: Native
Screen.Recording.2026-10-14.at.17.06.27.mov
iOS: mWeb Safari
Screen.Recording.2026-10-14.at.16.25.26.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-14.at.16.23.32.mov