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-06-19] Invoices - Invoice report field is deleted after deleting non-invoice report field #93232
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):odjosdjosjnojdiosj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Enable Invoices in workspace settings.
Go to staging.new.expensify.com
2 Go to workspace settings > Invoices.
Enable Invoice fields and upgrade workspace if needed.
Click Add field.
Create a text report field.
Go to workspace settings > Reports.
Enable Report fields.
Create a text report field, then delete it.
Go to workspace settings > Invoices.
Expected Result:
Invoice report field will remain unaffected after deleting non-invoice report field.
Actual Result:
Invoice report field is deleted after deleting non-invoice report field.
👋 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.
Report fields and invoice fields are stored together in the policy's fieldList, but deleteReportFields builds the API payload from only the same-target remaining fields and sends that as the new complete list. The backend then overwrites fieldList with that partial list, silently dropping the fields of the other target.
The optimistic Onyx data only marks the targeted key for deletion, which is why the invoice field disappears after the server response, not immediately.
The reverse path has the same defect: deleting an invoice field sends only remainingInvoiceFields, which would drop the expense report fields. The bug report only exercised one direction.
What changes do you think we should make in order to solve the problem?
The delete payload should preserve all remaining fields regardless of target, instead of filtering to the deleted field's target. Build the payload from the full set of remaining fields (updatedReportFieldsValues) so neither invoice nor expense fields are lost when the backend rewrites fieldList. The command/param name (reportFields vs invoiceFields) can still be chosen based on isInvoiceField, but the value passed should be the complete remaining list.
What alternative solutions did you explore? (Optional)
Make the backend DELETE_POLICY_REPORT_FIELD / DELETE_POLICY_INVOICE_FIELD commands target-aware (merge by ID rather than full overwrite). This is more robust but lives in the backend (Web-Expensify, not in this repo), so an internal engineer would need to confirm/own it. The App-side payload fix above is the minimal change to unblock the deploy.
Confidence: Medium-High. Code evidence is conclusive for the App-side payload omission. The one assumption is that the backend overwrites fieldList with the provided list — which the reported symptom strongly confirms. Introduced by #73887 (the invoice fields feature).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/93232) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Invoices - Invoice report field is deleted after deleting non-invoice report field[/-][+][Due for payment 2026-06-19] Invoices - Invoice report field is deleted after deleting non-invoice report field[/+]on Jun 12, 2026
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:
@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]
Activity
applause-bot commentedon Jun 11, 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/10ba6f3d05cb69d8868e10a9573dfb1df3643ff284af1a673fdd4dfa66a21adf
melvin-bot commentedon Jun 11, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #73887
melvin-bot commentedon Jun 11, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 11, 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:
MelvinBot commentedon Jun 11, 2026
Proposal
What is the root cause of that problem?
Report fields and invoice fields are stored together in the policy's
fieldList, butdeleteReportFieldsbuilds the API payload from only the same-target remaining fields and sends that as the new complete list. The backend then overwritesfieldListwith that partial list, silently dropping the fields of the other target.When you delete a non-invoice (expense) report field,
isInvoiceFieldisfalse, so theelsebranch sendsreportFields: JSON.stringify(remainingExpenseFields).remainingExpenseFieldsis filtered to exclude invoice-target fields, so the invoice field is omitted from the payload and gets deleted server-side.The optimistic Onyx data only marks the targeted key for deletion, which is why the invoice field disappears after the server response, not immediately.
Why this is the cause + symmetric bug
The reverse path has the same defect: deleting an invoice field sends only
remainingInvoiceFields, which would drop the expense report fields. The bug report only exercised one direction.What changes do you think we should make in order to solve the problem?
The delete payload should preserve all remaining fields regardless of target, instead of filtering to the deleted field's target. Build the payload from the full set of remaining fields (
updatedReportFieldsValues) so neither invoice nor expense fields are lost when the backend rewritesfieldList. The command/param name (reportFieldsvsinvoiceFields) can still be chosen based onisInvoiceField, but the value passed should be the complete remaining list.What alternative solutions did you explore? (Optional)
Make the backend
DELETE_POLICY_REPORT_FIELD/DELETE_POLICY_INVOICE_FIELDcommands target-aware (merge by ID rather than full overwrite). This is more robust but lives in the backend (Web-Expensify, not in this repo), so an internal engineer would need to confirm/own it. The App-side payload fix above is the minimal change to unblock the deploy.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/93232)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Jun 11, 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.
melvin-bot commentedon Jun 11, 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.
melvin-bot commentedon Jun 11, 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.
mollfpr commentedon Jun 11, 2026
Closing — the invoice fields feature has been reverted, so this no longer reproduces on staging.
[-]Invoices - Invoice report field is deleted after deleting non-invoice report field[/-][+][Due for payment 2026-06-19] Invoices - Invoice report field is deleted after deleting non-invoice report field[/+]melvin-bot commentedon Jun 12, 2026
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. 🎊
melvin-bot commentedon Jun 12, 2026
@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]