Skip to content

[Bulk workspace edits] Handle async copy failure in the Copy Policy Settings progress modal #92563

@MelvinBot

Description

@MelvinBot

Problem

Follow-up from #91368 (Copy Policy Settings progress modal).

The bulk copy runs asynchronously on the backend (BWM). When the job fails, the backend pushes state: 'failed' to the nvp_bulkPolicyCopySettings NVP — but the progress modal never reads that state. It only checks for 'complete' at CopyPolicySettingsProgressModal.tsx:26, and 'failed' is declared in the type but handled nowhere (CopyPolicySettingsNVP.ts:2).

As a result, on async failure the modal sits on "Copy in progress…" indefinitely with no error indication. The user's only escape is "Let me know when it's done" → "Dismiss", and they're never told the copy failed.

Note: the synchronous API failure is already covered (failureData resets currentStep to null and surfaces an RBR on the workspace rows). This issue is specifically about the async backend failure that arrives after the synchronous call has already succeeded.

Proposed handling

Add a failure state to the modal driven by nvp_bulkPolicyCopySettings.state === 'failed':

  • If the user did NOT request a Concierge notification (still on the in-progress modal, shouldSendToConcierge: false): show a failure state with a Try again action. COPY_POLICY_SETTINGS still holds sourcePolicyID, targetPolicyIDs, and parts (CopyPolicySettings.ts:4-12), so we can re-fire copyPolicySettings() directly from the modal — no need to send the user back through the 3-step flow.
  • If the user DID request a notification (shouldSendToConcierge: true): define the expected behavior for this case as well (e.g. surface the failure via Concierge and/or an RBR rather than the modal, since the user may have navigated away).

Copy/localization for the failure state will need to be added to src/languages/*.

Origin

Surfaced during final review of #91368 — see #91368 (comment).

Issue OwnerCurrent Issue Owner: @shubham1206agra

Metadata

Metadata

Labels

DailyKSv2InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewTask

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions