feat(editor): In setup panel only mark credentials as completed if they are tested#25658
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment has been minimized.
This comment has been minimized.
Bundle ReportChanges will increase total bundle size by 128.79kB (0.31%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
Files in
Files in
Files in
Files in
|
MiloradFilipovic
left a comment
There was a problem hiding this comment.
I feel like this adds some unnecessary redundancy to get the job done:
- When a credential is set up in the
CredentialEditmodal, it is being tested twice, both in the modal and in the composable in the background - We seem to be tracking tested credentials state both in the
setupPanel.storeanduseWorkflowSetupPanel
I would suggest a simpler approach:
- Instead of using
setupPanel.storeas a bridge between the modal and the setup panel, use thecredentials.storeto keep track of tested credentials and their test results - This way we remove
credentialsPendingTestcompletely and all of the new code to that store can be deleted - When a credential is tested from UI, we update it's test status in the
credentials.store useWorkflowSetupStatecomposable listens to this store and marks cards as completed/uncompleted as credential status changes - doesn't re-test anything- Keep the initial credentials check in the composable so we check them when the components load
We can also think about adding some loading state for the initial check, I think it's a bit unexpected for card statuses to change by themsleves
This comment has been minimized.
This comment has been minimized.
MiloradFilipovic
left a comment
There was a problem hiding this comment.
Looks good 👌
Left a minor comment to prevent memory leaks.
| * When a credential is deleted, unset it from ALL nodes that reference it. | ||
| * This is the symmetric counterpart to setCredential's auto-assignment. | ||
| */ | ||
| listenForCredentialChanges({ |
There was a problem hiding this comment.
I think we should also unsubscribe from store once the composable is diposed:
import { computed, onScopeDispose, watch, type Ref } from 'vue';
const stopListeningForCredentialChanges = listenForCredentialChanges({ ... });
onScopeDispose(stopListeningForCredentialChanges);|
Got released with |
|
Got released with |
Summary
Previously, the setup panel marked credential cards as complete as soon as a credential was selected, without verifying that the credential actually works. This could mislead users into thinking their workflow is properly configured when credentials are invalid.
Now, credential cards in the setup panel only show the checkmark after a background credential test
succeeds:
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/ADO-4817/only-mark-step-as-completed-if-credentials-work
Review / Merge checklist
(conventions)