Resolve vulnerability modal error race condition
What does this MR do and why?
Resolve vulnerability modal error race condition. Error message is being reset and not displayed due to race condition in the MR vulnerability modal.
Issue: #510296 (closed)
Note: this bug is difficult to replicate consistently as it really depends on the timing of things. The bugs only appear when the createVulnerabilityForFinding returns the error response BEFORE the resolveStart resets error message to ''
Scenario One: Error message is not displayed (the bug) 🐛
This is the scenario this MR is fixing.
createVulnerabilityForFinding returns error response
└──────────▶|
resolveStart resets error message to ''
└──────────────────────▶|
Result: No error message b/c '' wins
| Before | After |
|---|---|
![]() |
![]() |
Scenario two: Error message is displayed
As evident by: #509284 (comment 2267320731). There's nothing to fix here.
createVulnerabilityForFinding returns error response
└──────────────────────▶|
resolveStart resets error message to ''
└──────────▶|
Result: Display Error message
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- This first identified from this comment: #509284 (comment 2265177210)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Clone https://gitlab.com/gitlab-org/govern/threat-insights-demos/verification-projects/cwe-tests
- Run a pipeline
- Make an edit to file
cwe-328/ruby/cwe-328-fixed.rband create a new Merge Request
require 'digest/md5'
def hash_password(password)
Digest::MD5.hexdigest(password)
end
- Wait until the security scanning completes
- There should be a vulnerability
- Click on any vulnerability to open the modal
- Once the modal is open, open the dev tool
- Go to the "Network" tab and select
Offline - The error message should appear
Related to #510296 (closed)

