frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Audit Trail not updating in UI when adding multiple comments

Open ghost opened this issue 4 years ago • 3 comments

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:

  • Dependency-Track Version: 4.1.0
  • Distribution: Docker
  • BOM Format & Version:
  • Database Server: H2
  • Browser: Chrome Version 88.0.4324.182 (Official Build) (64-bit)

Additional Details:

None

ghost avatar Feb 23 '21 07:02 ghost

@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:

  • updating the frontend to make another call to get the updated analysis or
  • updating the backend to return analysisComments anytime a comment is added

zythosec avatar Mar 22 '21 22:03 zythosec

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

stevespringett avatar Mar 22 '21 22:03 stevespringett

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

rkg-mm avatar Dec 04 '23 18:12 rkg-mm