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
[Due for payment 2026-11-25] [$175] [CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot #106798
NewDot incorrectly displays missing-required-field errors for empty invoice report fields. The supplied screenshots show empty Customer Address and PO Number fields highlighted in red in NewDot, while the same invoice displays those fields without errors in Expensify Classic.
Reported platforms: NewDot web, staging and production. Version: Not provided.
Steps to reproduce
Open an invoice with empty Customer Address and PO Number invoice report fields in NewDot.
View the invoice's report fields.
Open the same invoice in Expensify Classic and compare.
Expected result
Empty invoice report fields display without missing-required-field errors, consistent with Classic and the invoice exemption described in the report.
Actual result
NewDot highlights the empty fields in red and displays:
“Customer Address is required”
“PO Number is required”
Classic displays the same empty fields without errors.
Requested frontend fix
Update local report-field validation in src/libs/ReportUtils.ts to respect the invoice exemption:
Do not generate missing-required-field errors for empty invoice fields.
Preserve required-field validation for expense reports and unrelated validation.
Add regression tests covering both report types.
Acceptance criteria
Empty Customer Address and PO Number invoice fields do not display required-field errors.
Empty required fields on expense reports still display the appropriate errors.
Unrelated validation remains unchanged.
Regression tests cover invoices and expense reports.
Evidence
Comparison screenshots are available in the source Slack thread. Customer-specific invoice and payment details are omitted from this public issue.
This issue records the reported behavior and requested fix; the code path and backend exemption have not been independently verified.
Local report-field validation treats empty invoice fields like empty expense-report fields, without checking whether the report is an invoice. This generates the reported required-field messages and red highlighting.
Code evidence
getFieldViolation() returns FIELD_REQUIRED whenever the field’s value/default is empty, regardless of report type.
Report-field rendering calls this helper and translates the result into the displayed error.
What changes do you think we should make in order to solve the problem?
Pass the report into getFieldViolation() and return no missing-required-field violation when isInvoiceReport(report) is true. Update both callers above.
Keep the existing expense-report value/default checks unchanged. Do not suppress API errors, circular-reference validation, or unrelated report violations.
Regression coverage:
Empty invoice fields—including Customer Address and PO Number—remain visible without required-field errors.
Empty required expense-report fields still show errors.
Empty invoice fields do not generate report-field warning indicators.
Populated values and default-value handling remain unchanged.
Extend the report-field UI tests with invoice-specific cases, including values stored in reportNameValuePairs.
What alternative solutions did you explore? (Optional)
Skip invoice validation separately in each caller. That would work, but centralizing the exemption avoids duplicated logic and keeps field errors and warning indicators consistent.
Code-based proposal; no changes or tests were run. Classic/backend behavior was not independently verified.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/106798#issuecomment-6840205884) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
It's used for the red error under the field in MoneyRequestViewReportFields (L164) and for the RBR in hasVisibleReportFieldViolations (L11218), and that one runs for invoice reports too (isInvoiceReport(report) ? policy?.areInvoiceFieldsEnabled : ...).
What's interesting is that the edit page already has its own idea of "required". DynamicEditReportFieldPage uses deletable (which is documented in PolicyReportField as "Tells if the field is required or not"):
So we have two different rules for the same thing. The view says every empty field is required, the edit page says only !deletable ones are. On top of that neither of them knows about the invoice exemption Classic has.
What changes do you think we should make in order to solve the problem?
Add one helper in ReportUtils and use it everywhere we decide if a report field is required:
functionisReportFieldRequired(reportField: PolicyReportField,report: OnyxEntry<Report>): boolean{// Invoice fields are never required, same as Classicif(isInvoiceReport(report)){returnfalse;}returnreportField.fieldID===CONST.REPORT_FIELD_TITLE_FIELD_ID||!reportField.deletable;}
getFieldViolation(reportField, report): return undefined early when !isReportFieldRequired(reportField, report), the rest stays as is. Update the 2 callers (MoneyRequestViewReportFields, hasVisibleReportFieldViolations) to pass the report, both already have it.
DynamicEditReportFieldPage: use isRequired={isReportFieldRequired(reportField, report)} for the text/date/dropdown pages instead of !isReportFieldDeletable, so you can actually clear an invoice field and save it empty without the form error. The Delete menu item logic stays on isReportFieldDeletable, nothing changes there.
Expense reports keep the same behaviour: fields created in NewDot are deletable: false (ReportField.ts L226) so they are still required, and the title field is unchanged.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
ReportUtilsTest:
empty invoice field -> getFieldViolation returns undefined, hasVisibleReportFieldViolations false
empty expense report field with deletable: false -> fieldRequired, RBR true
empty expense report field with deletable: true -> no violation
field with value or defaultValue -> no violation (both report types)
UI test for DynamicEditReportFieldPage: saving an empty value on an invoice field doesn't show "This field is required".
What alternative solutions did you explore? (Optional)
Only skip invoices inside getFieldViolation. It fixes the red text and the RBR, but the edit page would still refuse an empty value for the same field (and still ignore deletable), so the view and the edit page would keep disagreeing. Having one helper keeps them in sync.
📣 @SrkaLo92! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Please re-state the problem that we are trying to solve in this issue.
When viewing an invoice in NewDot that contains empty invoice report fields (such as Customer Address and PO Number), NewDot displays required-field errors in red under the inputs, whereas in Expensify Classic empty invoice report fields are exempt from missing-required-field errors and render without errors.
What is the root cause of that problem?
In src/libs/ReportUtils.ts, getFieldViolation unconditionally returns CONST.REPORT_VIOLATIONS.FIELD_REQUIRED whenever an empty report field does not have a value or defaultValue, without considering the report context or checking if the report is an invoice report. Consequently, when MoneyRequestViewReportFields.tsx resolves field violations for report fields rendered in an invoice report, it tags the empty fields with FIELD_REQUIRED, causing the UI to display the required field error in red.
What changes do you think we should make in order to solve the problem?
In src/libs/ReportUtils.ts, update getFieldViolation to accept an optional report?: OnyxEntry<Report> parameter. Inside the function, return undefined early if isInvoiceReport(report) evaluates to true (consistent with Classic's invoice report field exemption).
In src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx, pass the existing report prop into getFieldViolation(field, report) when mapping the report fields.
What alternative solutions did you explore? (Optional)
Directly checking isInvoiceReport(report) within MoneyRequestViewReportFields.tsx before invoking getFieldViolation. However, centralizing the exemption check inside getFieldViolation in ReportUtils.ts ensures consistent violation evaluation across any present or future consumers.
getFieldViolation treats every empty field without a value or defaultValue as violating CONST.REPORT_VIOLATIONS.FIELD_REQUIRED. It does not accept the report object or check whether the report is an invoice report (isInvoiceReport(report)) or whether reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE.
Callers pass empty fields without passing report context:
In src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx (line 164), const violation = isFieldDisabled ? undefined : getFieldViolation(field); evaluates violations for invoice fields without passing report, causing empty invoice fields to receive violation = 'fieldRequired' and render the red error message in NewDot.
In hasVisibleReportFieldViolations in src/libs/ReportUtils.ts (lines 11186–11219), while lines 11186–11194 explicitly include invoice reports (if (!isGroupPolicyReport && !isInvoiceReport(report)) return false;), line 11218 calls !!getFieldViolation(field) without report context, producing a false report-field violation (RBR) on unpaid invoices with empty fields.
In src/hooks/useSaveReportField.ts (line 65), hasOtherViolations flags any empty field (field.value === '') as an active violation without checking isInvoiceReport(report) or getFieldViolation(field, report), incorrectly flagging shouldFixViolations: true for invoice reports.
What changes do you think we should make in order to solve the problem?
Update getFieldViolation in src/libs/ReportUtils.ts (lines 14498–14504):
Update getFieldViolation signature to accept optional report?: OnyxInputOrEntry<Report>:
When the report is an invoice report (isInvoiceReport(report)), or when the field is specifically targeted to invoices (reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE), return undefined.
For all expense reports, existing behavior is 100% preserved.
Pass report to getFieldViolation in Callers:
src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx (line 164):
Pass report to getFieldViolation:
Update the existing test at lines 27690–27718 ('should return true when an unpaid invoice report has a required field with no value') to expect toBe(false), matching Classic and the invoice exemption specified in the issue.
Keep the expense report test at lines 27672–27688 expecting toBe(true).
Add dedicated unit tests for getFieldViolation:
Returns undefined for empty fields when report is an invoice report.
Returns undefined for empty fields when reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE.
Returns CONST.REPORT_VIOLATIONS.FIELD_REQUIRED for empty fields on expense reports.
Returns undefined when field has a value or defaultValue on any report type.
tests/ui/MoneyRequestViewReportFieldsTest.tsx:
Add a UI test verifying that empty invoice report fields (Customer Address, PO Number) on an invoice report render without error text and without red highlighting, while empty required fields on expense reports continue rendering <Field Name> is required.
What alternative solutions did you explore? (Optional)
Changing deletable field semantics across all report types:
We explored using !reportField.deletable as the required check as proposed by another contributor. However, PolicyReportField.deletable on workspace expense fields indicates whether the field can be removed from a report, and existing UI tests (tests/ui/MoneyRequestViewReportFieldsTest.tsx:401) use deletable: true while asserting that required-field errors display. Conflating deletable with the required status on expense reports introduces regressions in expense-report validation, violating the acceptance criteria ("Preserve required-field validation for expense reports and unrelated validation"). Scoping the exemption specifically to invoices via isInvoiceReport(report) || reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE is clean, robust, and completely regression-free.
Implemented in draft PR: Avoid required-field errors on empty invoice report fields, assigned to DylanDylann; 1,739 targeted tests and static checks passed. Browser verification was fixture-blocked—all four assertions remain unverified, not confirmed defects—and the full-suite timeout and tooling limitations are documented in the PR.
Step
Status
Open an unpaid invoice with empty Customer Address and PO NumberNo invoice fixture or invoice creation option was available.
⚠️
Invoice fields remain visible without required errors or red highlightingBlocked by unavailable invoice fixture.
⚠️
Empty required expense-report fields still show errorsNo configured required-field fixture was available.
⚠️
Empty invoice fields produce no report-field warning indicatorBlocked by unavailable invoice fixture.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-11-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
[-]Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/-][+][CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/+]trjExpensify commentedon Nov 13, 2026
@MelvinBot write a proposed solution for this.
melvin-bot commentedon Nov 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)[-][CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/-][+][$175] [CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/+]melvin-bot commentedon Nov 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022121039868249400432
MelvinBot commentedon Nov 13, 2026
Proposal
What is the root cause of that problem?
Local report-field validation treats empty invoice fields like empty expense-report fields, without checking whether the report is an invoice. This generates the reported required-field messages and red highlighting.
Code evidence
getFieldViolation()returnsFIELD_REQUIREDwhenever the field’s value/default is empty, regardless of report type.What changes do you think we should make in order to solve the problem?
Pass the report into
getFieldViolation()and return no missing-required-field violation whenisInvoiceReport(report)is true. Update both callers above.Keep the existing expense-report value/default checks unchanged. Do not suppress API errors, circular-reference validation, or unrelated report violations.
Regression coverage:
Test locations
reportNameValuePairs.What alternative solutions did you explore? (Optional)
Skip invoice validation separately in each caller. That would work, but centralizing the exemption avoids duplicated logic and keeps field errors and warning indicators consistent.
Code-based proposal; no changes or tests were run. Classic/backend behavior was not independently verified.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/106798#issuecomment-6840205884)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
SrkaLo92 commentedon Nov 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Empty invoice report fields (Customer Address, PO Number) show "X is required" in red in NewDot, while Classic shows them without errors.
What is the root cause of that problem?
getFieldViolationflags every empty field as required, it doesn't look at the report type or at the field's own required flag at all:https://github.com/Expensify/App/blob/d59adfd8/src/libs/ReportUtils.ts#L14498-L14504
It's used for the red error under the field in
MoneyRequestViewReportFields(L164) and for the RBR inhasVisibleReportFieldViolations(L11218), and that one runs for invoice reports too (isInvoiceReport(report) ? policy?.areInvoiceFieldsEnabled : ...).What's interesting is that the edit page already has its own idea of "required".
DynamicEditReportFieldPageusesdeletable(which is documented inPolicyReportFieldas "Tells if the field is required or not"):https://github.com/Expensify/App/blob/d59adfd8/src/pages/DynamicEditReportFieldPage.tsx#L139
So we have two different rules for the same thing. The view says every empty field is required, the edit page says only
!deletableones are. On top of that neither of them knows about the invoice exemption Classic has.What changes do you think we should make in order to solve the problem?
Add one helper in
ReportUtilsand use it everywhere we decide if a report field is required:getFieldViolation(reportField, report): returnundefinedearly when!isReportFieldRequired(reportField, report), the rest stays as is. Update the 2 callers (MoneyRequestViewReportFields,hasVisibleReportFieldViolations) to pass the report, both already have it.DynamicEditReportFieldPage: useisRequired={isReportFieldRequired(reportField, report)}for the text/date/dropdown pages instead of!isReportFieldDeletable, so you can actually clear an invoice field and save it empty without the form error. The Delete menu item logic stays onisReportFieldDeletable, nothing changes there.Expense reports keep the same behaviour: fields created in NewDot are
deletable: false(ReportField.tsL226) so they are still required, and the title field is unchanged.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
ReportUtilsTest:getFieldViolationreturns undefined,hasVisibleReportFieldViolationsfalsedeletable: false->fieldRequired, RBR truedeletable: true-> no violationUI test for
DynamicEditReportFieldPage: saving an empty value on an invoice field doesn't show "This field is required".What alternative solutions did you explore? (Optional)
Only skip invoices inside
getFieldViolation. It fixes the red text and the RBR, but the edit page would still refuse an empty value for the same field (and still ignoredeletable), so the view and the edit page would keep disagreeing. Having one helper keeps them in sync.melvin-bot commentedon Nov 13, 2026
📣 @SrkaLo92! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
SrkaLo92 commentedon Nov 13, 2026
Contributor details
Your Expensify account email: srdjanmarinkovic31@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/srdjanmarinkovic
melvin-bot commentedon Nov 13, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
1 remaining item
TassioSales commentedon Nov 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing an invoice in NewDot that contains empty invoice report fields (such as Customer Address and PO Number), NewDot displays required-field errors in red under the inputs, whereas in Expensify Classic empty invoice report fields are exempt from missing-required-field errors and render without errors.
What is the root cause of that problem?
In
src/libs/ReportUtils.ts,getFieldViolationunconditionally returnsCONST.REPORT_VIOLATIONS.FIELD_REQUIREDwhenever an empty report field does not have a value or defaultValue, without considering the report context or checking if the report is an invoice report. Consequently, whenMoneyRequestViewReportFields.tsxresolves field violations for report fields rendered in an invoice report, it tags the empty fields withFIELD_REQUIRED, causing the UI to display the required field error in red.What changes do you think we should make in order to solve the problem?
src/libs/ReportUtils.ts, updategetFieldViolationto accept an optionalreport?: OnyxEntry<Report>parameter. Inside the function, returnundefinedearly ifisInvoiceReport(report)evaluates totrue(consistent with Classic's invoice report field exemption).src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx, pass the existingreportprop intogetFieldViolation(field, report)when mapping the report fields.What alternative solutions did you explore? (Optional)
Directly checking
isInvoiceReport(report)withinMoneyRequestViewReportFields.tsxbefore invokinggetFieldViolation. However, centralizing the exemption check insidegetFieldViolationinReportUtils.tsensures consistent violation evaluation across any present or future consumers.kevinjosh10 commentedon Nov 14, 2026
Proposal
What is the root cause of that problem?
getFieldViolationinsrc/libs/ReportUtils.ts(lines 14498–14504) does not consider report context or exempt invoice reports:getFieldViolationtreats every empty field without a value or defaultValue as violatingCONST.REPORT_VIOLATIONS.FIELD_REQUIRED. It does not accept thereportobject or check whether the report is an invoice report (isInvoiceReport(report)) or whetherreportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE.Callers pass empty fields without passing report context:
src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx(line 164),const violation = isFieldDisabled ? undefined : getFieldViolation(field);evaluates violations for invoice fields without passingreport, causing empty invoice fields to receiveviolation = 'fieldRequired'and render the red error message in NewDot.hasVisibleReportFieldViolationsinsrc/libs/ReportUtils.ts(lines 11186–11219), while lines 11186–11194 explicitly include invoice reports (if (!isGroupPolicyReport && !isInvoiceReport(report)) return false;), line 11218 calls!!getFieldViolation(field)without report context, producing a false report-field violation (RBR) on unpaid invoices with empty fields.src/hooks/useSaveReportField.ts(line 65),hasOtherViolationsflags any empty field (field.value === '') as an active violation without checkingisInvoiceReport(report)orgetFieldViolation(field, report), incorrectly flaggingshouldFixViolations: truefor invoice reports.What changes do you think we should make in order to solve the problem?
Update
getFieldViolationinsrc/libs/ReportUtils.ts(lines 14498–14504):getFieldViolationsignature to accept optionalreport?: OnyxInputOrEntry<Report>:isInvoiceReport(report)), or when the field is specifically targeted to invoices (reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE), returnundefined.Pass
reporttogetFieldViolationin Callers:src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx(line 164):Pass
reporttogetFieldViolation:src/libs/ReportUtils.ts(hasVisibleReportFieldViolations, line 11218):Pass
reporttogetFieldViolation:src/hooks/useSaveReportField.ts(line 65):Gate
hasOtherViolationsso it does not flag empty invoice fields as violations:Update & Add Regression Tests:
tests/unit/ReportUtilsTest.ts:'should return true when an unpaid invoice report has a required field with no value') to expecttoBe(false), matching Classic and the invoice exemption specified in the issue.toBe(true).getFieldViolation:undefinedfor empty fields whenreportis an invoice report.undefinedfor empty fields whenreportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE.CONST.REPORT_VIOLATIONS.FIELD_REQUIREDfor empty fields on expense reports.undefinedwhen field has a value or defaultValue on any report type.tests/ui/MoneyRequestViewReportFieldsTest.tsx:<Field Name> is required.What alternative solutions did you explore? (Optional)
deletablefield semantics across all report types:We explored using
!reportField.deletableas the required check as proposed by another contributor. However,PolicyReportField.deletableon workspace expense fields indicates whether the field can be removed from a report, and existing UI tests (tests/ui/MoneyRequestViewReportFieldsTest.tsx:401) usedeletable: truewhile asserting that required-field errors display. Conflatingdeletablewith the required status on expense reports introduces regressions in expense-report validation, violating the acceptance criteria ("Preserve required-field validation for expense reports and unrelated validation"). Scoping the exemption specifically to invoices viaisInvoiceReport(report) || reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICEis clean, robust, and completely regression-free.Contributor details
Your Expensify account email: lkevinjosh10@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
DylanDylann commentedon Nov 17, 2026
@MelvinBot Implement this
MelvinBot commentedon Nov 17, 2026
🤖 Web test steps verification results: ❌ fail
Implemented in draft PR: Avoid required-field errors on empty invoice report fields, assigned to
DylanDylann; 1,739 targeted tests and static checks passed. Browser verification was fixture-blocked—all four assertions remain unverified, not confirmed defects—and the full-suite timeout and tooling limitations are documented in the PR.Open an unpaid invoice with empty Customer Address and PO Number
No invoice fixture or invoice creation option was available.Invoice fields remain visible without required errors or red highlighting
Blocked by unavailable invoice fixture.Empty required expense-report fields still show errors
No configured required-field fixture was available.Empty invoice fields produce no report-field warning indicator
Blocked by unavailable invoice fixture.view run · no recording available
expensify-chore-bot commentedon Nov 17, 2026
Triggered auto assignment to @carlosmiceli, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
[-][$175] [CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/-][+][Due for payment 2026-11-25] [$175] [CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/+]melvin-bot commentedon Nov 18, 2026
@DylanDylann
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-11-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]