Skip to content

[Due for payment 2026-06-19] Invoices - Inconsistency behavior of deleted invoice report field and expense report field #93240

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.4.5-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: #73887
Email or phone of affected tester (no customers): jsodinjosdjsoinjsiojs@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Enable Invoices in workspace settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Reports.
  3. Enable Report fields and upgrade workspace if needed.
  4. Create a text report field.
  5. Go to workspace chat.
  6. Create an expense.
  7. Delete the report field in Step 3.
  8. Open the expense report in Step 5.
  9. Click on the report field.
  10. Click 3-dot menu.
    → Deleted report field persists in expense report and it allows user to manually remove it.
  11. Go to workspace settings > Invoices.
  12. Enable Invoice fields and upgrade workspace if needed.
  13. Click Add field.
  14. Create a text report field.
  15. Send an invoice to any user.
  16. Delete the invoice report field in Step 13.
  17. Open the invoice report in Step 14.
    → Invoice report field disappears from invoice report after deleting it, which is inconsistent with expense report field which allows user to manually remove it.

Expected Result:

When invoice report field is deleted, it should behave the same as expense report field where it allows user to manually remove it via 3-dot menu.

Actual Result:

When invoice report field is deleted, the report field disappears from invoice report, which is inconsistent with expense report field which allows user to manually remove it (Step 9).

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7177444_1781137169289.12.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7177444

Activity

  1. applause-bot commented on Jun 11, 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/347da13ed9c31fed281c430a28cda01ab51f4f172b429dcf7ece9b80f8805d68

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 11, 2026
  3. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 11, 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.
  6. MelvinBot commented on Jun 11, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After deleting an invoice report field at the workspace level, the field disappears entirely from existing invoice reports. This is inconsistent with expense report fields, which persist on the report (and remain manually removable via the 3-dot menu) even after the policy-level field is deleted. Introduced by #73887 (invoice fields feature).

    What is the root cause of that problem?

    Expense and invoice report fields are persisted in two different places, and the function that decides which fields to render only looks at the expense one.

    The report view builds its field list from getAvailableReportFields, whose merged field set comes from the policy's fieldList ∪ the report's own report.fieldList — note the in-code comment: "Get the report fields that are attached to a report. These will persist even if a field is deleted from the policy."

    • Expense reports: the field is snapshotted into report.fieldList, so it stays in mergedFieldIds after the policy field is deleted → field persists and is removable.
    • Invoice reports: PR Implement invoice fields feature #73887 stores invoice field values in reportNameValuePairs (RNVP) instead, read via getReportFieldMaps (shouldReadReportNameValuePair = report.type === INVOICE && field.target === INVOICE). RNVP is only used to resolve a field's value — it is never added to mergedFieldIds. So an invoice field's presence depends entirely on the policy field still existing. Delete the policy field → it's not in policy.fieldList, not in report.fieldList → it drops out of mergedFieldIds → the field vanishes from the report.
    Evidence chain
    • getAvailableReportFields merge set: reportFields = Object.values(report.fieldList); mergedFieldIds = union(policyReportFields.fieldIDs, reportFields.fieldIDs) — RNVP not included (ReportUtils.ts:4567-4577).
    • RNVP is consumed only to override fieldValues/fieldsByName for fields already in the set (ReportUtils.ts:12917-12930).
    • Report view maps over sortedPolicyReportFields derived from those maps (MoneyReportView.tsx:139-145, :190).
    • PR Implement invoice fields feature #73887 also removed the early return true for invoice reports in isReportFieldDisabled, enabling manual removal — but that path is never reached because the field already disappears from mergedFieldIds.

    What changes do you think we should make in order to solve the problem?

    Make invoice fields persist on the report the same way expense fields do, so they survive policy-level deletion. Two viable directions:

    1. (Preferred) Include RNVP invoice fields in the merge set. In getAvailableReportFields, when report.type === INVOICE, also union in the invoice field IDs found in the report's reportNameValuePairs, and resolve their definition/value from RNVP when the policy field is absent. This mirrors how report.fieldList keeps deleted expense fields visible. (Note: getAvailableReportFields currently takes no RNVP arg, so it'd need RNVP passed in — getReportFieldMaps already has it loaded.)
    2. Snapshot invoice field into report.fieldList at invoice creation (as expense reports do), so the existing merge logic handles it with no read-path changes.

    Either way, the result is the deleted invoice field stays on the report and is removable via the 3-dot menu, matching expense behavior.

    Related issues

    • #93232 — "Invoice report field is deleted after deleting non-invoice report field" — also a deploy blocker from Implement invoice fields feature #73887, likely the same root cause (invoice fields not persisted independent of policy.fieldList). Worth fixing together.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93240) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. melvin-bot commented on Jun 11, 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.

  8. melvin-bot commented on Jun 11, 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.

  9. mollfpr commented on Jun 11, 2026

    @mollfpr
    Contributor

    Closing — the invoice fields feature has been reverted, so this no longer reproduces on staging.

  10. changed the title [-]Invoices - Inconsistency behavior of deleted invoice report field and expense report field[/-] [+][Due for payment 2026-06-19] Invoices - Inconsistency behavior of deleted invoice report field and expense report field[/+] on Jun 12, 2026
  11. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.6-4 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-06-19. 🎊

  12. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    @mollfpr The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions