Skip to content

fix(designer): warn before enabling trigger concurrency - #9560

Draft
Elaina Lee (Elaina-Lee) wants to merge 2 commits into
mainfrom
2433-repair
Draft

fix(designer): warn before enabling trigger concurrency#9560
Elaina Lee (Elaina-Lee) wants to merge 2 commits into
mainfrom
2433-repair

Conversation

@Elaina-Lee

@Elaina-Lee Elaina Lee (Elaina-Lee) commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Enabling trigger concurrency control is irreversible for a trigger once turned on � the setting cannot be switched off again after being saved/published. Previously, the designer's General settings toggle enabled this option immediately on click, with no warning that the choice is permanent.

This change adds an explicit user consent step: clicking the toggle to enable trigger concurrency control (from off to on, trigger operations only) now opens a confirmation dialog that states the setting can't be turned off once it takes effect. The toggle only takes effect after the user explicitly confirms via the dialog's "Enable" button; canceling leaves the setting untouched. Enabling/disabling concurrency on non-trigger (action) operations, and turning concurrency control off, are unaffected and continue to apply immediately, since only the trigger-enable path is irreversible.

This follow-up makes the lock itself save/publish-aware and reversible until then:

  • v1 (Consumption): after confirming, trigger concurrency remains reversible while the change is only an unsaved in-session edit. It becomes locked (read-only) only once the setting has actually been saved and the workflow definition reloaded, because that reflects the persisted, irreversible state. The confirmation dialog copy now says "After you save, concurrency control can't be turned off. You can change it while the workflow is in draft."
  • v2 (Standard/Stateful): the same reversible-until-committed behavior applies around publish instead of save � trigger concurrency stays reversible while the change only exists in an unpublished draft, and locks once the definition has been published and reloaded. The confirmation dialog copy says "After you publish, concurrency control can't be turned off. You can change it while the workflow is in draft."
  • The lock is derived from the persisted (last-loaded) operation definition, not from in-session setting edits, so it can't be tricked into locking (or unlocking) prematurely.
  • Renamed triggers stay correctly locked both before and after a same-session save/reinitialize: the lookup now resolves the persisted operation directly by the current node id first, falling back to the original (pre-rename) id via the id-replacement map, so a rename doesn't cause the persisted lock state to be missed or misapplied in either state shape.

Implements the fix requested in serverless-paas-balam/logic-apps-central#610.

Impact of Change

  • Users: When enabling trigger concurrency control in the designer's General settings panel, users see a confirmation dialog explaining the setting can't be turned off once it takes effect. The toggle remains changeable while the enablement is still an unsaved (v1) or unpublished draft (v2) change, and only locks (read-only) after that change has been saved/published and the workflow reloaded. Renamed triggers keep the correct locked/unlocked state across a same-session save-or-publish-and-reload. No change for actions or for disabling concurrency.
  • Developers: The shared Confirm dialog component (libs/designer-ui/src/lib/dialogs/confirm.tsx) has an optional confirmText prop to override the default "OK" primary button label. The v1 (libs/designer/...) and v2 (libs/designer-v2/...) General settings sections each add: a persisted-definition read (isTriggerConcurrencyEnabledInDefinition in core/actions/bjsworkflow/settings.ts) that checks the last-loaded operation definition rather than in-session edits; a workflow selector (getPersistedNodeOperation / getOriginalNodeId in core/state/workflow/workflowSelectors.ts) that resolves a node's persisted operation by direct id first and falls back to the pre-rename id via idReplacements; and a lockTriggerConcurrency prop threaded from settings/index.tsx into settings/sections/general.tsx that marks the trigger-concurrency toggle read-only once persisted-enabled. Warning copy for the confirmation dialog is now save/publish-specific per surface.
  • System: No performance, architecture, or dependency impact; purely additive UI confirmation/locking logic, new selectors, and new localized strings.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: Local unit test runs (targeted) � new triggerConcurrencyLock.spec.ts covering isTriggerConcurrencyEnabledInDefinition, getOriginalNodeId, and getPersistedNodeOperation resolution (direct-id-first with reverse-id fallback, before and after a same-session save/reinitialize) for both v1 (libs/designer) and v2 (libs/designer-v2); updated general.spec.tsx for both v1 and v2 covering the locked/reversible toggle states and confirmation copy. Targeted Biome/ESLint formatting and lint checks passed on all changed files.

Contributors

Screenshots/Videos

Pending � the confirmation dialog copy changed in this follow-up (save-specific wording for v1, publish-specific wording for v2), so the previously attached screenshot no longer reflects the current dialog text. Requesting a fresh screenshot of the updated confirmation dialog (both v1 "save" and v2 "publish" variants if feasible) before this leaves draft. No screenshot is being fabricated here.

Enabling trigger concurrency control is irreversible for a trigger,
so require explicit user confirmation before the toggle takes effect.
Adds a reusable confirm button label to the shared Confirm dialog and
wires a warning confirmation into the v1 and v2 designer General
settings sections when a trigger's concurrency control is switched on.

Fixes serverless-paas-balam/logic-apps-central#610

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Elaina-Lee Elaina Lee (Elaina-Lee) added the risk:low Low risk change with minimal impact label Aug 21, 2026
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(designer): warn before enabling trigger concurrency
  • Issue: None — uses a valid fix(scope): prefix and is descriptive.
  • Recommendation: No change needed.

Commit Type

  • Exactly one box selected: fix - Bug fix.
  • Correct choice — this adds a guarded confirmation/lock around an irreversible trigger setting.

Risk Level

  • Declared Low (body) and label risk:low match, and this matches the advised estimate. The diff is UI-only (confirmation dialog + read-only lock + new selectors/strings) scoped to libs/designer, libs/designer-v2, and one additive optional prop in libs/designer-ui. No shared-runtime, security, API, or governance impact → low is correct.

What & Why

  • Current: Detailed explanation of the irreversible trigger-concurrency setting, the confirmation dialog, and the save/publish-aware reversible-until-committed lock behavior.
  • Issue: None.
  • Recommendation: No change needed.

Impact of Change

  • All three audiences addressed (Users, Developers, System) with concrete detail.
  • Recommendation:
    • Users: Well described (confirmation dialog + lock-after-save/publish).
    • Developers: Well described (new confirmText prop, selectors, lockTriggerConcurrency).
    • System: Well described (purely additive, no perf/dependency impact).

Test Plan

  • Unit tests added/updated and confirmed in the diff: new triggerConcurrencyLock.spec.ts (v1 + v2), updated general.spec.tsx (v1 + v2), and confirm.spec.tsx. Covers dialog flow, lock/reversible states, and rename resolution. Passes CHECK TESTS.

⚠️ Contributors

  • Section is blank. Consider crediting the PM/designer who requested this (referenced issue logic-apps-central#610) or any reviewers. Non-blocking.

Screenshots/Videos

  • This change adds a new user-facing confirmation dialog and touches libs/designer-ui/src/lib/dialogs/confirm.tsx, libs/designer/src/lib/ui/settings/, and libs/designer-v2/src/lib/ui/settings/ — clearly a visual UI change. The section is marked "Pending" with no image/video attached. Per CHECK SCREENSHOTS this blocks merge.
  • Recommendation: Attach a screenshot (or short video) of the updated confirmation dialog for both variants — the v1 "After you save…" copy and the v2 "After you publish…" copy — before this leaves draft.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level risk:low is correct
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests confirmed
Contributors ⚠️ Credit PM/designer/reviewers
Screenshots/Videos Add dialog screenshots (v1 save + v2 publish)

Blocked: everything checks out except Screenshots/Videos. Please attach screenshots of the updated confirmation dialog (both the v1 "save" and v2 "publish" wording) and this PR will pass. Risk level is correctly declared as low.


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Sat, 22 Aug 2026 00:41:15 GMT

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage check completed. See workflow run for details.

@Elaina-Lee
Elaina Lee (Elaina-Lee) marked this pull request as ready for review August 21, 2026 22:31
Copilot AI balanced review requested due to automatic review settings August 21, 2026 22:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds confirmation before irreversibly enabling trigger concurrency in both designer versions.

Changes:

  • Gates trigger concurrency behind an Enable/Cancel dialog.
  • Adds customizable confirmation-button text.
  • Adds localized strings and unit coverage.

Readiness: Missing required screenshot; validate-pr, build, coverage, and several E2E checks are not green. Two formatting findings remain.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Localize/lang/strings.json Adds dialog strings.
libs/designer/src/lib/ui/settings/sections/general.tsx Adds v1 confirmation flow.
libs/designer/src/lib/ui/settings/__tests__/general.spec.tsx Tests v1 behavior.
libs/designer-v2/src/lib/ui/settings/sections/general.tsx Adds v2 confirmation flow.
libs/designer-v2/src/lib/ui/settings/__tests__/general.spec.tsx Tests v2 behavior.
libs/designer-ui/src/lib/dialogs/confirm.tsx Adds configurable confirm text.
libs/designer-ui/src/lib/dialogs/__test__/confirm.spec.tsx Tests dialog labels and callbacks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

description: 'Title for the confirmation dialog before enabling trigger concurrency control',
});
const enableConcurrencyConfirmationMessage = intl.formatMessage({
defaultMessage: `After you turn on concurrency control, this setting can't be changed.`,
description: 'Title for the confirmation dialog before enabling trigger concurrency control',
});
const enableConcurrencyConfirmationMessage = intl.formatMessage({
defaultMessage: `After you turn on concurrency control, this setting can't be changed.`,
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-pr-update risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants