fix(document-store): sync top-level credential on confluence loader update#6560
fix(document-store): sync top-level credential on confluence loader update#6560SyncWithRaj wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the saveProcessingLoader function in the document store service to properly handle and synchronize credentials. Specifically, it ensures that the system only falls back to an existing credential if no new credential is provided directly or within loaderConfig (checking both credential and FLOWISE_CREDENTIAL_ID). Additionally, it syncs the top-level credential from loaderConfig when updating or creating loaders. There are no review comments to address, so I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Description
Closes #6550
Problem Statement:
When a user updates the credentials for a document loader (e.g., Confluence) via the Flowise UI, the system maintains two separate credential references inside the
document_storedatabase table'sloadersJSON column:loaderConfig.credentialand the top-levelcredential. The UI correctly updatedloaderConfig.credential, but the top-levelcredentialretained the old, stale UUID. Because downstream operations like/refreshand/processread the top-levelcredential, users received 403/404 authorization errors after changing credentials.Root Cause:
In
packages/server/src/services/documentstore/index.ts(saveProcessingLoader):data.credentialwith the old DB value (found.credential).loader.credentialwas never explicitly synced fromloaderConfig.credentialorloaderConfig.FLOWISE_CREDENTIAL_ID.The Fix:
loaderConfig.loader.credentialfromloaderConfigon both the loader update and loader creation paths.How to Test
loaderscolumn: verify all credential fields sync to Cred A.loaderscolumn: verify the top-levelcredentialis now correctly synced to Cred B instead of remaining stuck on Cred A.