Skip to content

[Due for payment 2026-09-17] Invoice - Fix badge is displayed for paid invoices in LHN when the report field is missing. #100790

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


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:

  1. Launch app
  2. Keep login 2 account via track business expenses
  3. In account B - enable invoice and enter invoice details
  4. Send invoice to account A
  5. Enable invoice field toggle and add a text field without entering initial value
  6. Go to LHN and note Fix badge is shown
  7. Open account A and pay the invoice
  8. Open account B and note LHN shows fix badge in paid invoice
  9. 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.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7255796_1789022499114.Screenrecorder-2026-09-10-11-59-18-539.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7255796

Issue OwnerCurrent Issue Owner: @rojiphil

Activity

  1. added
    DeployBlockerCash
    Bug
    on Sep 10, 2026
  2. applause-bot commented on Sep 10, 2026

    @applause-bot
    Author

    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

  3. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #93317

  4. github-actions commented on Sep 10, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @mollfpr @rojiphil you have been assigned to this deploy blocker because you reviewed the offending PR: #93317

  6. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #93317

  7. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  8. 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
  9. MelvinBot commented on Sep 10, 2026

    @MelvinBot
    Contributor

    🔍 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. DeployBlockerCash is correct and kept (App-side fix required). DeployBlocker was not present, so nothing to remove.

    Suggested fix

    src/libs/ReportUtils.ts#L9999-L10002 — drop the isGroupPolicyReport && scoping so the lifecycle guard applies to invoice reports too:

    // 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)) {
        return false;
    }

    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.
    📋 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 at reportAttributes.ts#L616 and then into getReasonAndReportActionThatHasRedBrickRoad, which sets ACTION_BADGE.FIX.

    Before #93317, that function could never return true for an invoice report, for two independent reasons:

    1. Its entry gate required policy?.areReportFieldsEnabled; Implement invoice fields feature #93317 changed it to use areInvoiceFieldsEnabled for invoice reports.
    2. More importantly, isReportFieldDisabled began with a blanket if (isInvoiceReport(report)) { return true; } at the PR's base commit. Every invoice field was therefore "disabled", the isReportFieldDisabledForUser(...) 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.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:

    const isGroupPolicyReport = isExpenseReport(report) && isGroupPolicyPolicyUtils(policy);
    if (!isGroupPolicyReport && !isInvoiceReport(report)) { return false; }
    
    // We only show the RBR to the submitter for expense reports
    if (isGroupPolicyReport && !isCurrentUserSubmitter(report)) { return false; }
    
    // Allow both open and processing reports to show RBR for field violations (expense reports only)
    if (isGroupPolicyReport && !isOpenOrProcessingReport(report)) { return false; }

    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.

  10. added
    Reviewing
    on Sep 10, 2026
  11. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    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.

  12. lanitochka17 commented on Sep 10, 2026

    @lanitochka17

    Deploy Blocker #100876 was identified to be related to the PR #100850 that attempted to fix this issue.

  13. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    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.

  14. m-natarajan commented on Sep 10, 2026

    @m-natarajan

    Not repro in Win / Chrome, 9.4.75-3

    Recording.3504.mp4
  15. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Sep 10, 2026
  16. removed
    Reviewing
    on Sep 10, 2026
  17. 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
  18. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions