Skip to content

fix(credential-manager): ensure unique name and id when creating credentials - #6132

Merged
jarekdanielak merged 2 commits into
developfrom
fix/credentials-unique-id
Aug 25, 2026
Merged

fix(credential-manager): ensure unique name and id when creating credentials#6132
jarekdanielak merged 2 commits into
developfrom
fix/credentials-unique-id

Conversation

@jarekdanielak

Copy link
Copy Markdown
Contributor

Problem

If credentials are created with the default name and ID combo, the next time I open the create modal, I see errors, cause the defaults are the same.

Not a great UX.

Screen.Recording.2026-08-24.at.13.18.28.mov

Proposed Changes

Ensure the default values for name and ID are unique, by adding a number incrementally:

Screen.Recording.2026-08-24.at.13.16.53.mov

Steps to try out

  1. Create credentials with the default name and ID.
  2. Open Create modal again.
  3. Before, you see errors on name and ID.
  4. After, you see no errors.

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

Copilot AI lite review requested due to automatic review settings August 24, 2026 11:26
@bpmn-io-tasks bpmn-io-tasks Bot added the needs review Review pending label Aug 24, 2026
@github-actions

Copy link
Copy Markdown

This Pull Request targets develop branch, but contains fix commits.

Consider targeting main instead.

@jarekdanielak
jarekdanielak requested a review from a team August 24, 2026 11:27
@jarekdanielak
jarekdanielak force-pushed the fix/credentials-unique-id branch 2 times, most recently from 823d22f to f78d559 Compare August 24, 2026 11:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the credential creation UX in the cloud credential manager by ensuring the default “Credential name” (display name) and “Credential ID” suggested in the modal are unique relative to existing credentials, preventing immediate validation errors when reopening the create modal.

Changes:

  • Add getUniqueCredentialIdentity(...) to derive a non-colliding (displayName, credentialId) pair when opening the modal in create mode.
  • Update CredentialModal to use the new helper for initial state in create mode.
  • Add a unit test asserting unique name/ID suggestions when collisions already exist.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
client/src/app/modals/credentials/CredentialModal.js Uses a new helper to initialize unique default display name + ID in create mode.
client/src/app/modals/credentials/credentialId.js Adds helper that finds a unique credential identity based on existing credentials.
client/src/app/modals/credentials/tests/CredentialModalSpec.js Adds test coverage for the unique suggestion behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread client/src/app/modals/credentials/credentialId.js
@jarekdanielak
jarekdanielak force-pushed the fix/credentials-unique-id branch from f78d559 to b3d5c4c Compare August 24, 2026 11:45
@nikku

nikku commented Aug 24, 2026

Copy link
Copy Markdown
Member

What is our strategy? Try 1, 2, 3, 4 until one "does not exist"?

@nikku

nikku commented Aug 24, 2026

Copy link
Copy Markdown
Member

(We could instead append a generated ID in case of a clash).

@jarekdanielak

Copy link
Copy Markdown
Contributor Author

What is our strategy? Try 1, 2, 3, 4 until one "does not exist"?

Pretty much.

(We could instead append a generated ID in case of a clash).

We could. I chose an incremented number simply cause it looks better on the display name.

@barmac

barmac commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

That aligns with the connection manager; I think it's fine:

image

@barmac

barmac commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

You will rename it anyway.

}
}

throw new Error('Unable to generate a unique credential identity.');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will crash the editor if ever reached - do we want that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, shouldn't happen, but let's not blow up the modeler.

Fixed in 98fbf68 - we log error and return something to display.

@jarekdanielak
jarekdanielak merged commit c8cb52c into develop Aug 25, 2026
17 checks passed
@bpmn-io-tasks bpmn-io-tasks Bot removed the needs review Review pending label Aug 25, 2026
@jarekdanielak
jarekdanielak deleted the fix/credentials-unique-id branch August 25, 2026 07:24
@github-actions github-actions Bot added this to the M105 milestone Aug 25, 2026
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.

4 participants