The Hook
When an application security engineer selects 50 vulnerabilities for bulk dismissal and a transient GraphQL error rejects the mutation, forgetting a four-line finally block leaves the triage form permanently locked in isSubmitting = true—forcing a full page reload and wiping out the engineer's entire multi-select triage state.
The Deep Dive
High-density enterprise workflows—such as bulk-triaging vulnerabilities on a Security Dashboard or converting work item types across an agile hierarchy—depend on deterministic client-side state machines around asynchronous GraphQL mutations. In a Vue/Apollo frontend, mutation handlers typically set a mutex flag (this.isSubmitting = true) prior to dispatching the network call to prevent duplicate submissions and disable form inputs while the transaction is in flight.
While authoring MR !271080 (fix: unlock bulk dismissal form after failure) in gitlab-org/gitlab (approved by Hannah Baker), I traced what happened in the vulnerability bulk dismissal component when the GraphQL mutation rejected due to a network interruption or backend validation error. Because isSubmitting was only reset along the happy path (or omitted from error recovery), any rejected promise left isSubmitting stuck at true, permanently disabling the dismissal controls until the user refreshed the browser and lost their filtered selection set. By moving the isSubmitting = false transition into a finally block in MR !271080, the component deterministically unlocks its controls while preserving the user's selected vulnerabilities and dismissal comment for immediate retry.
A parallel state-transition subtlety appeared in GitLab's Work Items architecture when converting work item types (for example, changing an Issue with attached CRM contacts to another work item type). In MR !269469 (Fix contacts warning when changing work item type), I fixed the widget capability check so the CRM contacts data-loss warning triggers accurately whenever a work item with existing contacts transitions to a target type that lacks the contacts widget.
The GitLab Hero Angle
Across both enterprise Vulnerability Management bulk triage (MR !271080) and Work Item hierarchy conversions (MR !269469), GitLab engineers fault-tolerant frontend state machines that preserve user selection state across GraphQL faults and surface proactive data-integrity warnings before mutations commit.
The Takeaway
Always release UI submission locks (isSubmitting = false) inside a finally clause rather than inside .then() callbacks so transient GraphQL mutation failures never deadlock bulk operational workflows.