fix(core): Filter stale credentials from setup wizard requests#28478
Open
fix(core): Filter stale credentials from setup wizard requests#28478
Conversation
The setup wizard was asking users to configure credentials for nodes that don't need them (e.g. HTTP Request with authentication set to 'none'). Stale node.credentials entries from earlier builder revisions were being surfaced unconditionally.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Architecture diagram
sequenceDiagram
participant UI as Setup Wizard
participant Svc as SetupWorkflowService
participant Adapter as InstanceAiAdapterService
participant Desc as Node Description
participant Creds as CredentialService
Note over UI,Creds: Identifying required credentials for a node
UI->>Svc: buildSetupRequests(node)
Svc->>Adapter: getNodeCredentialTypes(node)
Adapter->>Desc: Get node description
Note over Adapter: Step 1-3: Resolve via displayOptions,<br/>issues, and dynamic resolution
rect rgb(240, 240, 240)
Note over Adapter: CHANGED: Step 4 (unconditional addition<br/>of existingCredentials) REMOVED
Adapter-->>Svc: Array of validated credential types
end
alt if credentialTypes is empty
Note over Svc: NEW: Fallback logic no longer<br/>checks node.credentials (stale data)
Svc->>Desc: Get static credentials from description
loop for each static credential
Svc->>Svc: NEW: Filter using matchesDisplayOptions(parameters)
end
Svc-->>Svc: Filtered list of required types
end
loop for each identified credentialType
Svc->>Creds: list({ type: credentialType })
Creds-->>Svc: Found credentials
end
Svc-->>UI: Setup requests (filtered for current context)
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline Idle baseline with Instance AI module loaded
docker-stats
Memory consumption baseline with starter plan resources
How to read this table
|
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
The setup wizard was asking users to configure credentials for nodes that don't need them (e.g., an HTTP Request node calling a public API with
authentication: 'none').Root cause: Stale
node.credentialsentries, left over from earlier builder revisions, were being surfaced unconditionally in two places:getNodeCredentialTypes()in the adapter had a "Step 4" that added all existing credentials without checking if they're still neededbuildSetupRequests()checkednode.credentialsfirst, bypassing the displayOptions-filtered pathFix:
node.credentialsfallback inbuildSetupRequests(): now only the displayOptions-filtered path from the node description is usedRelated Linear ticket
https://linear.app/n8n/issue/AI-2366