DependencyTrack / frontend

Frontend UI for Dependency-Track
https://dependencytrack.org/
Apache License 2.0
106 stars 159 forks source link

Audit Trail not updating in UI when adding multiple comments #58

Open ghost opened 3 years ago

ghost commented 3 years ago

Current Behavior:

When adding several comments to an Audit Trail, only the first comment appears in the UI.

Steps to Reproduce:

  1. In DT, open a project and then the Audit Vulnerabilities tab.
  2. Expand a vulnerability (click on >) to reveal the vuln details.
  3. Enter "a comment" into the Comment box and click Add Comment. The comment appears in the Audit Trail box above.
  4. Enter "another comment" into the Comment box and click Add Comment.

Expected Behavior:

"another comment" appears in the Audit Trail box but it does not. Refreshing the webpage reveals that the second comment was added to the Audit Trail but was just not displayed when added.

I would also have expected a comment in the Comment box to be cleared when it is added to the Audit Trail.

Environment:

Additional Details:

None

zythosec commented 3 years ago

@stevespringett I did a little investigation into this issue, and it appears it may be due to the API not always returning the analysisComments field. If you notice in the screenshot below, when first adding a comment, analysisComments is in the response:

dt-1

When adding a second comment in the screen shot below, analysisComments is missing:

dt-2

this causes updateAnalysisData on the frontend to skip the update and not update the audit trail here: https://github.com/DependencyTrack/frontend/blob/f44bdde24ce6244904161ac9fef6e8ca1d5563b4/src/views/portfolio/projects/ProjectFindings.vue#L236

From what I can see this could be fixed by either:

stevespringett commented 3 years ago

Thanks interesting. Thanks for finding the cause. Will attempt to reproduce.

rkg-mm commented 12 months ago

@nscuro I checked, this bug is no longer existing and can be closed