fix(credential-manager): ensure unique name and id when creating credentials - #6132
Conversation
|
This Pull Request targets Consider targeting |
823d22f to
f78d559
Compare
There was a problem hiding this comment.
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 increatemode. - Update
CredentialModalto use the new helper for initial state increatemode. - 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.
f78d559 to
b3d5c4c
Compare
|
What is our strategy? Try |
|
(We could instead append a generated ID in case of a clash). |
Pretty much.
We could. I chose an incremented number simply cause it looks better on the display name. |
|
You will rename it anyway. |
| } | ||
| } | ||
|
|
||
| throw new Error('Unable to generate a unique credential identity.'); |
There was a problem hiding this comment.
This will crash the editor if ever reached - do we want that?
There was a problem hiding this comment.
Yea, shouldn't happen, but let's not blow up the modeler.
Fixed in 98fbf68 - we log error and return something to display.

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
Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool