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-09-17] Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing. #100790
Version Number: V9.4.75-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#93317 Email or phone of affected tester (no customers):dreamnitethedragon+vegst@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redmi note 10s android 13 App Component: Money Requests
Action Performed:
Launch app
Keep login 2 account via track business expenses
In account B - enable invoice and enter invoice details
Send invoice to account A
Enable invoice field toggle and add a text field without entering initial value
Go to LHN and note Fix badge is shown
Open account A and pay the invoice
Open account B and note LHN shows fix badge in paid invoice
Open the invoice details and recheck lhn and note Fix badge is shown
Expected Result:
Fix badge musnt be displayed for paid invoices in LHN when the report field is missing.
Actual Result:
Fix badge is displayed for paid invoices in LHN when the report field is missing.
Note : In case of report field missing, fix badge disappears in paid workspace expense from LHN.
👋 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.
changed the title [-]Invoice-Fix badge is displayed for paid invoices in LHN when the report field is missing.[/-][+]Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing.[/+]on Sep 10, 2026
Classification: Frontend bug Causing PR: #93317 - "Implement invoice fields feature" by @ShridharGoel (High confidence) Related Issues: None found
Recommendation: ROLL FORWARD
The root cause is a one-line gap in a single guard in hasVisibleReportFieldViolations — the settled/closed lifecycle guard is scoped to expense reports only, so it never applies to invoices. Reverting #93317 would back out the entire invoice fields feature (90+ files) for a badge-visibility bug, so a targeted fix is far safer than a revert.
Assigned: @ShridharGoel (PR author), @mollfpr and @rojiphil (approving reviewers) — already assigned by Melvin, no change needed. Labels: No changes. DeployBlockerCash is correct and kept (App-side fix required). DeployBlocker was not present, so nothing to remove.
// Field violations are only actionable while the report can still move forward,// so a settled/closed report never shows an RBR for a missing field.if(!isOpenOrProcessingReport(report)){returnfalse;}
This is safe for both report types:
A sent, unpaid invoice is stateNum: SUBMITTED / statusNum: SUBMITTED (buildOptimisticInvoiceReport), so isProcessingReport is true → the Fix badge still shows for unpaid invoices with a missing field (existing behavior preserved).
A paid invoice becomes statusNum: REIMBURSED (PayMoneyRequest.ts#L362-L363) → isOpenOrProcessingReport is false → badge is hidden, matching the expense report behavior the reporter observed.
Expense reports are unaffected, since the guard already ran for them.
Before #93317, that function could never return true for an invoice report, for two independent reasons:
Its entry gate required policy?.areReportFieldsEnabled; Implement invoice fields feature #93317 changed it to use areInvoiceFieldsEnabled for invoice reports.
#93317 removed that early return (see the diff of src/libs/ReportUtils.ts in the PR), which is what activated the invoice branch of this function for the first time. It is on the 9.4.75-0 checklist (item 20), merged 2026-09-09, one day before this report — and it is the only PR in the checklist that touches report field violation logic. This matches "not reproducible in production — new feature".
Verification
Affected file: src/libs/ReportUtils.ts (hasVisibleReportFieldViolations, isReportFieldDisabled), consumed by src/libs/actions/OnyxDerived/configs/reportAttributes.ts for the LHN badge.
gh pr view 93317 --json files confirms src/libs/ReportUtils.ts is modified by the PR, and the diff shows both the removal of the invoice early return in isReportFieldDisabled and the areInvoiceFieldsEnabled change in hasVisibleReportFieldViolations.
I compared the function bodies at the PR base commit (a9e376b) against current main to confirm the type-scoped guards themselves pre-date Implement invoice fields feature #93317 and were simply unreachable for invoices until this PR.
Root Cause
Inside hasVisibleReportFieldViolations, isGroupPolicyReport is defined as isExpenseReport(report) && isGroupPolicy(policy), and both lifecycle-style guards are conjoined with it:
constisGroupPolicyReport=isExpenseReport(report)&&isGroupPolicyPolicyUtils(policy);if(!isGroupPolicyReport&&!isInvoiceReport(report)){returnfalse;}// We only show the RBR to the submitter for expense reportsif(isGroupPolicyReport&&!isCurrentUserSubmitter(report)){returnfalse;}// Allow both open and processing reports to show RBR for field violations (expense reports only)if(isGroupPolicyReport&&!isOpenOrProcessingReport(report)){returnfalse;}
For an expense report, a paid report is statusNum: REIMBURSED, so isOpenOrProcessingReport is false and the third guard returns early → no Fix badge. That is exactly the behavior the reporter noted as correct.
For an invoice report, isGroupPolicyReport is false, so both guards are skipped entirely and execution falls straight through to the field loop. There, getFieldViolation is purely value-based (return value ?? defaultValue ? undefined : FIELD_REQUIRED) and has no notion of report state, so an empty field keeps reporting fieldRequired forever.
The one remaining thing that could have suppressed it — isReportFieldDisabledForUser — does not, because isReportFieldDisabled gates its settled/closed check on !isAdmin. The invoice sender in the repro steps is the workspace admin, so the field stays editable after payment and the violation survives. (The invoice receiver does not see the badge, because isAdminOwnerApproverOrReportOwner fails for them — consistent with the report, which only mentions account B seeing it.)
So the settled-state protection for expense reports comes from the isOpenOrProcessingReport guard, not from field disabled-ness, and that guard was never extended to the invoice path that #93317 opened up.
changed the title [-]Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing.[/-][+][Due for payment 2026-09-17] Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing.[/+]on Sep 10, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.75-3 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-09-17. 🎊
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
applause-bot commentedon Sep 10, 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/b1bdbcfbf85b90bdf48369c28aad017fc3467219a2e0991ef7cb640978af813d
melvin-bot commentedon Sep 10, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #93317
github-actions commentedon Sep 10, 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:
melvin-bot commentedon Sep 10, 2026
@mollfpr @rojiphil you have been assigned to this deploy blocker because you reviewed the offending PR: #93317
melvin-bot commentedon Sep 10, 2026
@ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #93317
melvin-bot commentedon Sep 10, 2026
💬 A slack conversation has been started in #expensify-open-source
[-]Invoice-Fix badge is displayed for paid invoices in LHN when the report field is missing.[/-][+]Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing.[/+]MelvinBot commentedon Sep 10, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #93317 - "Implement invoice fields feature" by @ShridharGoel (High confidence)
Related Issues: None found
Recommendation: ROLL FORWARD
The root cause is a one-line gap in a single guard in
hasVisibleReportFieldViolations— the settled/closed lifecycle guard is scoped to expense reports only, so it never applies to invoices. Reverting #93317 would back out the entire invoice fields feature (90+ files) for a badge-visibility bug, so a targeted fix is far safer than a revert.Assigned: @ShridharGoel (PR author), @mollfpr and @rojiphil (approving reviewers) — already assigned by Melvin, no change needed.
Labels: No changes.
DeployBlockerCashis correct and kept (App-side fix required).DeployBlockerwas not present, so nothing to remove.Suggested fix
src/libs/ReportUtils.ts#L9999-L10002— drop theisGroupPolicyReport &&scoping so the lifecycle guard applies to invoice reports too:This is safe for both report types:
stateNum: SUBMITTED / statusNum: SUBMITTED(buildOptimisticInvoiceReport), soisProcessingReportistrue→ the Fix badge still shows for unpaid invoices with a missing field (existing behavior preserved).statusNum: REIMBURSED(PayMoneyRequest.ts#L362-L363) →isOpenOrProcessingReportisfalse→ badge is hidden, matching the expense report behavior the reporter observed.📋 Detailed Analysis
Evidence
The Fix badge / RBR for a missing report field is driven entirely by
hasVisibleReportFieldViolations, which is fed into the LHN derived attributes atreportAttributes.ts#L616and then intogetReasonAndReportActionThatHasRedBrickRoad, which setsACTION_BADGE.FIX.Before #93317, that function could never return
truefor an invoice report, for two independent reasons:policy?.areReportFieldsEnabled; Implement invoice fields feature #93317 changed it to useareInvoiceFieldsEnabledfor invoice reports.isReportFieldDisabledbegan with a blanketif (isInvoiceReport(report)) { return true; }at the PR's base commit. Every invoice field was therefore "disabled", theisReportFieldDisabledForUser(...)check inside the.some()short-circuited, and no invoice field violation was ever produced.#93317 removed that early return (see the diff of
src/libs/ReportUtils.tsin the PR), which is what activated the invoice branch of this function for the first time. It is on the 9.4.75-0 checklist (item 20), merged 2026-09-09, one day before this report — and it is the only PR in the checklist that touches report field violation logic. This matches "not reproducible in production — new feature".Verification
src/libs/ReportUtils.ts(hasVisibleReportFieldViolations,isReportFieldDisabled), consumed bysrc/libs/actions/OnyxDerived/configs/reportAttributes.tsfor the LHN badge.gh pr view 93317 --json filesconfirmssrc/libs/ReportUtils.tsis modified by the PR, and the diff shows both the removal of the invoice early return inisReportFieldDisabledand theareInvoiceFieldsEnabledchange inhasVisibleReportFieldViolations.a9e376b) against currentmainto confirm the type-scoped guards themselves pre-date Implement invoice fields feature #93317 and were simply unreachable for invoices until this PR.Root Cause
Inside
hasVisibleReportFieldViolations,isGroupPolicyReportis defined asisExpenseReport(report) && isGroupPolicy(policy), and both lifecycle-style guards are conjoined with it:For an expense report, a paid report is
statusNum: REIMBURSED, soisOpenOrProcessingReportisfalseand the third guard returns early → no Fix badge. That is exactly the behavior the reporter noted as correct.For an invoice report,
isGroupPolicyReportisfalse, so both guards are skipped entirely and execution falls straight through to the field loop. There,getFieldViolationis purely value-based (return value ?? defaultValue ? undefined : FIELD_REQUIRED) and has no notion of report state, so an empty field keeps reportingfieldRequiredforever.The one remaining thing that could have suppressed it —
isReportFieldDisabledForUser— does not, becauseisReportFieldDisabledgates its settled/closed check on!isAdmin. The invoice sender in the repro steps is the workspace admin, so the field stays editable after payment and the violation survives. (The invoice receiver does not see the badge, becauseisAdminOwnerApproverOrReportOwnerfails for them — consistent with the report, which only mentions account B seeing it.)So the settled-state protection for expense reports comes from the
isOpenOrProcessingReportguard, not from field disabled-ness, and that guard was never extended to the invoice path that #93317 opened up.melvin-bot commentedon Sep 10, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
lanitochka17 commentedon Sep 10, 2026
Deploy Blocker #100876 was identified to be related to the PR #100850 that attempted to fix this issue.
melvin-bot commentedon Sep 10, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
m-natarajan commentedon Sep 10, 2026
Not repro in Win / Chrome, 9.4.75-3
Recording.3504.mp4
[-]Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing.[/-][+][Due for payment 2026-09-17] Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing.[/+]melvin-bot commentedon Sep 10, 2026
@rojiphil
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.75-3 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-09-17. 🎊
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]