fix: unlock bulk dismissal form after failure
What does this MR do and why?
This MR fixes an issue where the bulk vulnerability dismissal form remains locked when the dismissal mutation fails.
Previously, this.isSubmitting was reset only after a successful mutation. If the mutation failed, the form remained in its submitting state, preventing users from interacting with it or retrying the operation.
This MR moves the submission-state reset into a finally block to ensure that the form is unlocked regardless of whether the mutation succeeds or fails.
It also adds regression tests covering:
- Ensuring no success event or success toast is emitted after a failed mutation.
- Verifying that the form controls are unlocked after a failed submission.
- Ensuring users can retry the submission after a failure.
- Verifying that Sentry receives the expected error reports without duplicate reporting within a single attempt.
References
Closes #640171
Screenshots or screen recordings
Not applicable. This MR addresses frontend submission-state handling without introducing visual changes.
Before
After
How to set up and validate locally
-
Check out the source branch:
fix-640171-bulk-dismissal-loading-state -
Run the focused Jest spec:
yarn jest ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/bulk_change_status_spec.js --runInBand -
Run Prettier:
yarn prettier --check \ ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/bulk_change_status.vue \ ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/bulk_change_status_spec.js -
Run ESLint:
yarn eslint \ ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/bulk_change_status.vue \ ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/bulk_change_status_spec.js
Validation results:
- Jest: 67 tests passed.
- Prettier: Passed.
- ESLint: Passed.
git diff --check: Passed.
MR acceptance checklist
Evaluated against the MR acceptance checklist.
- The change addresses the reported failure-state handling issue.
- Regression tests cover the failed mutation scenario.
- Form controls are verified to unlock after failure.
- Retry behaviour is covered by tests.
- Existing success and error handling behaviour is preserved.
- No unrelated files or functionality were modified.
- Focused tests, linting, and formatting checks pass.