Skip to content

Workspace - No upgrade page when copying settings with additional workflow to Collect ws #95691

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.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.
  1. Go to staging.new.expensify.com
  2. Go to Workspaces.
  3. Click 3-dot menu on Control workspace > Copy settings.
  4. Select Collect workspace > Next.
  5. Select Members and Workflows > Next.
  6. 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.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7203713_1783596312003.3.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @fedirjh

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 9, 2026
  2. applause-bot commented on Jul 9, 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/1dad63ceac63a6764e2e365f925d1f0801e720b46ca7bbf19220d74f80c46a4b

  3. melvin-bot commented on Jul 9, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jul 9, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 9, 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 Jul 9, 2026

    @MelvinBot
    Contributor

    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, 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.

  7. self-assigned this
    on Jul 9, 2026
  8. fedirjh commented on Jul 9, 2026

    @fedirjh
    Contributor

    @yuwenmemon This seems the same root cause as #95722 (comment).

  9. fedirjh commented on Jul 9, 2026

    @fedirjh
    Contributor
  10. fedirjh commented on Jul 12, 2026

    @fedirjh
    Contributor

    This was fixed

    CleanShot.2026-07-12.at.16.32.29.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions