Skip to content

Commit

Permalink
Bugfix/In-mem VS not able to load document (#2542)
Browse files Browse the repository at this point in the history
fix where in-mem VS not able to load document
  • Loading branch information
HenryHengZJ authored May 31, 2024
1 parent 04e0ce1 commit 6a58ae4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/server/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ export const saveUpsertFlowData = (nodeData: INodeData, upsertHistory: Record<st
/**
* Check if doc loader should be bypassed, ONLY if doc loader is connected to a vector store
* Reason being we dont want to load the doc loader again whenever we are building the flow, because it was already done during upserting
* EXCEPT if the vector store is a memory vector store
* TODO: Remove this logic when we remove doc loader nodes from the canvas
* @param {IReactFlowNode} reactFlowNode
* @param {IReactFlowNode[]} reactFlowNodes
Expand Down Expand Up @@ -406,7 +407,8 @@ const checkIfDocLoaderShouldBeIgnored = (

if (targetNodeId) {
const targetNodeCategory = reactFlowNodes.find((nd) => nd.id === targetNodeId)?.data.category || ''
if (targetNodeCategory === 'Vector Stores') {
const targetNodeName = reactFlowNodes.find((nd) => nd.id === targetNodeId)?.data.name || ''
if (targetNodeCategory === 'Vector Stores' && targetNodeName !== 'memoryVectorStore') {
return true
}
}
Expand Down

0 comments on commit 6a58ae4

Please sign in to comment.