Error messages for vulnerability dismissal actions on MR widget are not displaying
Summary
When opening the vulnerability modal via the MR security widget and performing one of the following actions the modal gets closed without giving the user a chance to read it:
action | recording |
---|---|
dismiss vulnerability | dismiss |
dismiss vulnerability with comment | dimiss_comment |
delete dismissal comment | delete_comment |
undo dismissal | undo_dismissal |
Steps to reproduce
- Go to an open MR
- Click on a vulnerability within the Security Widget
- Open your browser's developer tools and change your throttle-network settings to be offline
- Either dismiss, dismiss with comment, delete comment or undo dismissal
- The vulnerability modal will close before the error message can be read
Example Project
gitlab-examples/security/security-reports!2 (closed)
What is the current bug behavior?
The vulnerability modal closes before the error message can be read.
What is the expected correct behavior?
The vulnerability modal should not close automatically in case of an error.
Possible fixes
-
Rethrow error within
catch
blocks of relevant actions (dismissVulnerability
,addDismissalComment
,deleteDismissalComment
,revertDismissVulnerability
) within https://gitlab.com/gitlab-org/gitlab/-/blob/af27c54ba6589e8eb0d627ae4369782158e1e098/ee/app/assets/javascripts/vue_shared/security_reports/store/actions.js#L183 -
Catch error within handlers: https://gitlab.com/gitlab-org/gitlab/-/blob/af27c54ba6589e8eb0d627ae4369782158e1e098/ee/app/assets/javascripts/vue_shared/security_reports/mixins/vulnerability_modal_mixin.js