add new check for overrideconfig to fix bug where external prediction call reset flow

This commit is contained in:
Henry 2023-05-10 23:33:19 +01:00
parent 24ceeb8671
commit d83b57c349
2 changed files with 6 additions and 2 deletions

View File

@ -378,7 +378,6 @@ export class App {
nodeToExecuteData = this.chatflowPool.activeChatflows[chatflowid].endingNodeData nodeToExecuteData = this.chatflowPool.activeChatflows[chatflowid].endingNodeData
} else { } else {
/*** Get chatflows and prepare data ***/ /*** Get chatflows and prepare data ***/
const flowData = chatflow.flowData const flowData = chatflow.flowData
const parsedFlowData: IReactFlowObject = JSON.parse(flowData) const parsedFlowData: IReactFlowObject = JSON.parse(flowData)
const nodes = parsedFlowData.nodes const nodes = parsedFlowData.nodes

View File

@ -398,15 +398,20 @@ export const isSameOverrideConfig = (
existingOverrideConfig?: ICommonObject, existingOverrideConfig?: ICommonObject,
newOverrideConfig?: ICommonObject newOverrideConfig?: ICommonObject
): boolean => { ): boolean => {
// Skip check if its internal call
if (isInternal) return true if (isInternal) return true
// If existing and new overrideconfig are the same
if ( if (
existingOverrideConfig && existingOverrideConfig &&
Object.keys(existingOverrideConfig).length && Object.keys(existingOverrideConfig).length &&
newOverrideConfig && newOverrideConfig &&
Object.keys(newOverrideConfig).length && Object.keys(newOverrideConfig).length &&
JSON.stringify(existingOverrideConfig) === JSON.stringify(newOverrideConfig) JSON.stringify(existingOverrideConfig) === JSON.stringify(newOverrideConfig)
) ) {
return true return true
}
// If there is no existing and new overrideconfig
if (!existingOverrideConfig && !newOverrideConfig) return true
return false return false
} }