Skip to content

Fix api-key comment not updating - #1858

Open
Nihad74 wants to merge 1 commit into
DependencyTrack:mainfrom
Nihad74:api-key-comment-fix
Open

Nihad74 wants to merge 1 commit into
DependencyTrack:mainfrom
Nihad74:api-key-comment-fix

Conversation

@Nihad74

@Nihad74 Nihad74 commented Sep 17, 2026

Copy link
Copy Markdown

Description

Fixes API key comments not updating immediately in the UI after being changed.

The API response for API keys without a comment does not include the comment property. Since the frontend uses Vue 2, assigning the property directly later does not make it reactive. This change uses this.$set when updating the API key comment so the UI is updated immediately.

Addressed Issue

Fixes #1225

Additional Details

The original fix for v4 normalized missing API key comments to an empty string in multiple places.

For v5, the issue can be fixed more minimally at the point where the comment is updated:

this.$set(this.apiKey, 'comment', response.data.comment);

This ensures that the comment property is reactive even when it was not present on the API key object initially.
Tested manually with:

  • API key without an existing comment
  • API key with an existing comment
  • Clearing an existing comment
  • Newly created API key

Checklist

  • I have read and understand the contributing guidelines
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly -> this is a small bug fix ; no need to update documentation

@owasp-dt-bot

owasp-dt-bot commented Sep 17, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Signed-off-by: Nihad Uddin <nihad.uddin@rohde-schwarz.com>
@Nihad74
Nihad74 force-pushed the api-key-comment-fix branch from b06b1e8 to 8ad59a7 Compare September 18, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API key comment not updating in UI

2 participants