Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { INodeParams, INodeCredential } from '../src/Interface'
const scopes = [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive.metadata'
Expand Down
16 changes: 14 additions & 2 deletions packages/ui/src/views/docstore/LoaderConfigPreviewChunks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import documentStoreApi from '@/api/documentstore'
import documentsApi from '@/api/documentstore'

// Const
import { baseURL, gridSpacing } from '@/store/constant'
import { baseURL, gridSpacing, FLOWISE_CREDENTIAL_ID } from '@/store/constant'
import { closeSnackbar as closeSnackbarAction, enqueueSnackbar as enqueueSnackbarAction } from '@/store/actions'
import { useError } from '@/store/context/ErrorContext'

Expand Down Expand Up @@ -147,7 +147,7 @@ const LoaderConfigPreviewChunks = () => {
if (
inputParam.type === 'credential' &&
!selectedDocumentLoader.credential &&
!selectedDocumentLoader.inputs['FLOWISE_CREDENTIAL_ID']
!selectedDocumentLoader.inputs[FLOWISE_CREDENTIAL_ID]
) {
canSubmit = false
missingFields.push(inputParam.label || inputParam.name)
Expand Down Expand Up @@ -317,6 +317,18 @@ const LoaderConfigPreviewChunks = () => {
nodeData.credential = existingLoaderFromDocStoreTable.credential
setLoaderName(existingLoaderFromDocStoreTable.loaderName)
}
// Restore credential from the separate `credential` field on the loader entity.
// This block intentionally runs outside the loaderConfig guard above because
// `loader.credential` is persisted as its own DB column — independent of
// loaderConfig — and may be the *only* place the credential ID is stored for
// loaders created before FLOWISE_CREDENTIAL_ID was written into inputs.
// Without this, checkMandatoryFields and prepareConfig both miss the credential,
// causing a false "Connect Credential" validation error on process/preview.
if (existingLoaderFromDocStoreTable?.credential) {
nodeData.credential = existingLoaderFromDocStoreTable.credential
if (!nodeData.inputs) nodeData.inputs = {}
nodeData.inputs[FLOWISE_CREDENTIAL_ID] = existingLoaderFromDocStoreTable.credential
}
setSelectedDocumentLoader(nodeData)

// Check if the loader has a text splitter, if yes, get the text splitter nodes
Expand Down
Loading