Fix dismissed vulnerability comment updates
What does this MR do?
Context
We are using the data from requests to two different endpoints to populate the vulnerability-details modal:
- Security Report (
security-reports/-/merge_requests/{id}/sast_reports
) - Vulnerability Feedback (
security-reports/-/vulnerability_feedback?category=sast
)
Both request's response data is used within the vuex-state:
state.modal.vulnerability.dismissal_feedback
state.modal.vulnerability.dismissalFeedback
Within the modal we use .dismissal_feedback
first and if that is not available then we fall back to .dismissalFeedback
Issue
It looks like the first endpoint is cached but the second one is not.
When a new dismissal gets created the first endpoint will include it until the cache expires, so the data from the second endpoint (state.vulnerability.dismissalFeedback
) is used. Everything works as expected.
Once the first endpoint's response includes the dismissal feedback (and state.vulnerability.dismissal_feedback
is used) we run into the caching problem and updates to comments, etc. will not be reflected in the UI until cache expiry.
Proposed solution
Use .dismissal_feedback
as a fallback and use .dismissalFeedback
when it is available.
Considerations
The modal is also used on the security dashboards, where we only populate .dismissal_feedback
. The proposed change will not affect this, since
we use .dismissal_feedback
as a fallback.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Related to #118818 (closed)