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
Workspace - No upgrade page when copying settings with additional workflow to Collect ws #95691
Version Number: 9.4.32-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:#94060 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:
Log in with Expensifail account.
Create a Control workspace, invite User B to the workspace, create a workflow where User B submits to User B.
Create a Collect workspace.
Go to staging.new.expensify.com
Go to Workspaces.
Click 3-dot menu on Control workspace > Copy settings.
Select Collect workspace > Next.
Select Members and Workflows > Next.
Click Copy settings.
Expected Result:
Upgrade page will open because Workflows involve additional workflow which is a Control feature.
Actual Result:
Upgrade page is not shown when Workflows involve additional workflow which is a Control feature.
Copy progress loads infinitely as a result.
👋 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.
Root Cause: The Copy settings upgrade gate decides whether a Collect target needs upgrading at the feature granularity, but "additional approver" workflows are Control-only at a sub-feature granularity that the check can't see.
When you pick Workflows, getControlOnlySelectedParts maps the part to ARE_WORKFLOWS_ENABLED via PART_TO_POLICY_FEATURE and asks canPolicyAccessFeature whether the Collect target can access it. Basic workflows are available on Collect, so ARE_WORKFLOWS_ENABLED is not in the corporate-only set and the check returns true — no upgrade step is shown (shouldShowCopyPolicySettingsUpgradeStep). But a workflow with more than one approver is Control-only — the normal editor already gates it with !isControlPolicy(policy) && approverCount > 0 → Upgrade page (ApprovalWorkflowEditor.tsx:157-168). The Copy flow has no equivalent granular check, so it skips the upgrade, attempts to copy a multi-approver workflow onto a Team policy that can't hold it, and the confirm-screen progress never resolves (infinite load).
Recommended Fix: Make the workflows part control-gated based on the source's workflow shape, not just the feature flag. In getControlOnlySelectedParts, add a special case: when part === 'workflows' and the source policy has any approval workflow with more than one approver (a multi-level / additional-approver chain), treat it as control-only for any Collect target — the same condition the editor uses. That routes the copy through the existing Upgrade step and prevents the stuck copy.
Investigation details & evidence
Repro path (from the issue): Control WS has a workflow where User B submits to User B (source has an approval chain); copying Members + Workflows to a Collect WS should open the Upgrade page but doesn't, and copy spins forever.
Why the gate misses it:
canPolicyAccessFeature only lists ARE_RULES_ENABLED, ARE_PER_DIEM_RATES_ENABLED, IS_HR_ENABLED as corporate-only (PolicyUtils.ts:1408-1412). ARE_WORKFLOWS_ENABLED is intentionally not there because Collect supports basic approvals.
The Control restriction on workflows is specifically the additional approver (multi-level chain), enforced in the editor at ApprovalWorkflowEditor.tsx:157. Copy settings has no matching check.
Detecting a multi-approver workflow on the source: approval workflows are built by convertPolicyEmployeesToApprovalWorkflows in WorkflowUtils.ts, where each workflow carries an approvers array (chained via forwardsTo). A workflow with approvers.length > 1 is the "additional approval workflow" that's Control-only — this is the condition to reuse.
Alternative considered: gating on whether the target already has the feature won't help — the target is a fresh Collect WS, and the problem is the source data shape, not the target's current toggles. The fix must inspect the source policy's workflow chain.
Secondary hardening (optional): the confirm screen showing an infinite spinner suggests the copy has no failure/timeout handling for a rejected part. Even with the upgrade gate fixed, a backend rejection of any part should surface an error instead of hanging — worth a follow-up.
Fix location:Expensify/App only — all involved code is in the App repo.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/95691) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Activity
applause-bot commentedon Jul 9, 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/1dad63ceac63a6764e2e365f925d1f0801e720b46ca7bbf19220d74f80c46a4b
melvin-bot commentedon Jul 9, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #94060
melvin-bot commentedon Jul 9, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 9, 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 Jul 9, 2026
Issue Analysis
Root Cause: The Copy settings upgrade gate decides whether a Collect target needs upgrading at the feature granularity, but "additional approver" workflows are Control-only at a sub-feature granularity that the check can't see.
When you pick Workflows,
getControlOnlySelectedPartsmaps the part toARE_WORKFLOWS_ENABLEDviaPART_TO_POLICY_FEATUREand askscanPolicyAccessFeaturewhether the Collect target can access it. Basic workflows are available on Collect, soARE_WORKFLOWS_ENABLEDis not in the corporate-only set and the check returnstrue— no upgrade step is shown (shouldShowCopyPolicySettingsUpgradeStep). But a workflow with more than one approver is Control-only — the normal editor already gates it with!isControlPolicy(policy) && approverCount > 0→ Upgrade page (ApprovalWorkflowEditor.tsx:157-168). The Copy flow has no equivalent granular check, so it skips the upgrade, attempts to copy a multi-approver workflow onto a Team policy that can't hold it, and the confirm-screen progress never resolves (infinite load).Recommended Fix: Make the workflows part control-gated based on the source's workflow shape, not just the feature flag. In
getControlOnlySelectedParts, add a special case: whenpart === 'workflows'and the source policy has any approval workflow with more than one approver (a multi-level / additional-approver chain), treat it as control-only for any Collect target — the same condition the editor uses. That routes the copy through the existing Upgrade step and prevents the stuck copy.Investigation details & evidence
Repro path (from the issue): Control WS has a workflow where User B submits to User B (source has an approval chain); copying Members + Workflows to a Collect WS should open the Upgrade page but doesn't, and copy spins forever.
Why the gate misses it:
canPolicyAccessFeatureonly listsARE_RULES_ENABLED,ARE_PER_DIEM_RATES_ENABLED,IS_HR_ENABLEDas corporate-only (PolicyUtils.ts:1408-1412).ARE_WORKFLOWS_ENABLEDis intentionally not there because Collect supports basic approvals.ApprovalWorkflowEditor.tsx:157. Copy settings has no matching check.Detecting a multi-approver workflow on the source: approval workflows are built by
convertPolicyEmployeesToApprovalWorkflowsinWorkflowUtils.ts, where each workflow carries anapproversarray (chained viaforwardsTo). A workflow withapprovers.length > 1is the "additional approval workflow" that's Control-only — this is the condition to reuse.Alternative considered: gating on whether the target already has the feature won't help — the target is a fresh Collect WS, and the problem is the source data shape, not the target's current toggles. The fix must inspect the source policy's workflow chain.
Secondary hardening (optional): the confirm screen showing an infinite spinner suggests the copy has no failure/timeout handling for a rejected part. Even with the upgrade gate fixed, a backend rejection of any part should surface an error instead of hanging — worth a follow-up.
Fix location:
Expensify/Apponly — all involved code is in the App repo.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/95691)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
fedirjh commentedon Jul 9, 2026
@yuwenmemon This seems the same root cause as #95722 (comment).
fedirjh commentedon Jul 9, 2026
Should be fixed in:
fedirjh commentedon Jul 12, 2026
This was fixed
CleanShot.2026-07-12.at.16.32.29.mp4