fix(credentials): resolve case-mismatched credential lookups returning 500#1063
Merged
Conversation
…g 500 The canvas's "Add new credential" inline button on saved chatflows was hitting `GET /components-credentials/JiraApi` (legacy PascalCase) while the live credential pool only registers `jiraApi` (camelCase). The strict-case lookup raised NOT_FOUND, then the outer catch in componentsCredentialsService re-wrapped every error as 500, masking the real status with a doubled "Error: ... - Error: ..." message. - Add case-insensitive fallback in getComponentByName / getSingleComponentsCredentialIcon that resolves to the canonical pool key when an exact match fails. - Stop re-wrapping InternalFlowiseError in the service catch so 404 stays 404 instead of becoming 500. - Update stale getSingleComponentsCredential strings to match the actual function name (getComponentByName) so future grepping works. - In the canvas CredentialInputHandler, normalize credentialNames against the live components list before issuing the lookup, and surface unresolved names via a persistent error toast instead of silently console.erroring. - Add a one-shot AAI migration that rewrites legacy strings inside chat_flow.flowData (any element of credentialNames arrays or value of a credentialName key) and inside credential.credentialName rows. Driven by a small legacy -> canonical map (currently just JiraApi -> jiraApi) so PascalCase credentials like PostgresApi / MySQLApi are intentionally untouched.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…CredentialInputHandler
ct3685
added a commit
that referenced
this pull request
May 5, 2026
## 🚀 Release: Staging to Production **Release Date:** 2026-05-05 ### Changes in this release - feat(csv-transformer): API-sourced worker status, global theme fixes, and CSV UI polish (#1066) (1a2dd33) - chore(llmchain): drop noisy *****FINAL RESULT***** console output (#1065) (1154e74) - fix(credentials): resolve case-mismatched credential lookups returning 500 (#1063) (e2db107) --- *This PR is automatically created/updated when commits are pushed to staging.* *Merging this PR will trigger the release workflow to create a new GitHub release.* --------- Co-authored-by: Cameron Taylor <50385537+ct3685@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the 500 error users hit when clicking Add new credential inline on a Jira node in an existing chatflow. Root cause was a case mismatch between the legacy
JiraApibaked into saved chatflow JSON and the live credential pool keyjiraApi, compounded by an over-broadcatchin the components-credentials service that masked NOT_FOUND as 500.Three layers of defense, plus a code review:
componentsCredentialsService.getComponentByName/getSingleComponentsCredentialIconnow do a case-insensitive fallback against the in-memory pool, and thecatchre-throwsInternalFlowiseErroras-is so 404 stays 404.CredentialInputHandler.addAsyncOptionresolves stalecredentialNamesto the current canonical key before issuing the lookup, and surfaces unresolved names as a persistent error toast instead of silentlyconsole.error-ing.1770000000001-NormalizeLegacyCredentialNames) rewritesJiraApi->jiraApiinsidechat_flow.flowDataJSON (in anycredentialNamesarray orcredentialNamefield) and inside thecredential.credentialNamecolumn. Idempotent, narrowLIKEpre-filter, no-opdown().JIRA_ATLASSIAN_REVIEW.mdwalks every Jira / Atlassian touchpoint with prioritized findings (6 Critical / 6 High / 6 Medium / 6 Low) for follow-up tickets.Why no node version bumps
No node interface or
init()behavior changed. The migration is reconciling stored data with credential code that already saysname: 'jiraApi'. Version bumps would only be needed if/when we act on review findings H2 (host validation) or M3 (move host onto the credential).Test plan
Out of scope (called out in the review doc)