Skip to content

[Due for payment 2026-06-19] Invoice - Invoice fields are not enabled after duplicating workspace with invoice fields #93241

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): applausetester+ssndjois2jd1@applause.expensifail.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.
  • Add a bank account in workspace settings > Invoices.
  • Enable Invoice fields and create any field.
  1. Go to staging.new.expensify.com
  2. Go to Workspaces tab.
  3. Click 3-dot menu next to the workspace with invoices enabled.
  4. Click Duplicate workspace.
  5. Click Next > Continue.
  6. Open the duplicated workspace.
  7. Go to Invoices.

Expected Result:

Invoice fields will be enabled after duplicating workspace with invoice fields.

Actual Result:

Invoice fields are not enabled after duplicating workspace with invoice fields.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7177458_1781139098706.13.mp4

View all open jobs on GitHub

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

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jun 11, 2026
  2. 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/6a03170f4dcd407640b6992ca150f0bfb4eb2926a3d143a3e134a7e4327d8c21

  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

    Issue Analysis

    Root Cause: Workspace duplication doesn't carry over the new invoice fields feature (PR #73887, same deploy). The duplicate flow never tells the backend to copy areInvoiceFieldsEnabled or the invoice‑target fields, so the duplicated workspace comes back with invoice fields disabled.

    Two gaps work together:

    1. No invoice‑fields flag is sent to the backend. The parts payload built for the DuplicatePolicy command lists every feature (reports, invoices, taxes, …) but has no key for invoice fields — WorkspaceDuplicateSelectFeaturesForm.tsx:234-250, serialized and sent at Policy.ts:3626-3642. The backend DuplicatePolicy command predates invoice fields and has no instruction to copy them.

    2. The optimistic builder doesn't handle invoice fields either. buildOptimisticDuplicatePolicy explicitly sets areInvoicesEnabled but never sets areInvoiceFieldsEnabled (it only survives via the ...sourcePolicy spread), and it gates the whole fieldList on the reports feature: fieldList: isReportsFeatureSelected ? … : undefined (Policy.ts:3331). Invoice fields are stored in that same fieldList (distinguished by target === INVOICE, see WorkspaceInvoiceFieldsSection.tsx:19-22), so they're not tied to the invoices feature at all.

    Because the bug reproduces in staging (i.e. after the server response), the authoritative backend policy is what's missing the feature — the DuplicatePolicy command isn't copying areInvoiceFieldsEnabled or the invoice‑target entries of fieldList.

    ⚠️ This fix requires a backend change outside the App repo. The DuplicatePolicy command (Auth / Web‑Expensify) must copy the areInvoiceFieldsEnabled flag and the invoice‑target report fields when duplicating. That should be driven off the invoices part (or a new invoiceFields part) — not the reports part. An internal engineer with access to that repo needs to implement it. The App side should be updated in tandem to (a) send an invoice‑fields signal in parts, (b) explicitly set areInvoiceFieldsEnabled in buildOptimisticDuplicatePolicy, and (c) stop gating invoice‑target fieldList entries on the reports feature.

    Investigation details & evidence
    • Invoice fields feature toggle is policy.areInvoiceFieldsEnabled (Policy.ts type:2331-2332); the actual fields live in policy.fieldList filtered by target === CONST.REPORT_FIELD_TARGETS.INVOICE.
    • The duplicate dialog selects all features by default (WorkspaceDuplicateSelectFeaturesForm.tsx:359), so even the optimistic copy of fieldList happens — yet the staging result still shows invoice fields disabled, confirming the server response overrides the optimistic data.
    • Success data for the duplicated policy only clears pendingFields (incl. areReportFieldsEnabled but not areInvoiceFieldsEnabled) — Policy.ts:3500-3515. It relies on the backend to return the authoritative policy, which doesn't include the invoice‑fields feature.
    • Alternative considered: a purely-frontend optimistic bug. Ruled out because the issue reproduces in staging against the real API — the optimistic builder (with all features selected) would otherwise show invoice fields enabled.

    Next Steps for Contributor+ team:
    Backend fix required — the root cause is in the DuplicatePolicy command outside the App repo; please escalate to an internal engineer to copy the invoice‑fields feature on duplication.
    To refine: @MelvinBot <your feedback>

  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. removed
    DeployBlockerCash
    on Jun 11, 2026
  11. added
    Daily
    and removed
    Hourly
    on Jun 12, 2026
  12. changed the title [-]Invoice - Invoice fields are not enabled after duplicating workspace with invoice fields[/-] [+][Due for payment 2026-06-19] Invoice - Invoice fields are not enabled after duplicating workspace with invoice fields[/+] on Jun 12, 2026
  13. 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. 🎊

  14. 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]

  15. added a commit that references this issue on Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions