Skip to content
Open
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
11 changes: 10 additions & 1 deletion packages/server/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1829,16 +1829,25 @@ export const getMemorySessionId = (
if (!isInternal) {
// Provided in API body - incomingInput.overrideConfig: { sessionId: 'abc' }
if (incomingInput.overrideConfig?.sessionId) {
return incomingInput.overrideConfig?.sessionId
if (typeof incomingInput.overrideConfig.sessionId !== 'string') {
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid sessionId: must be a string')
}
Comment thread
yau-wd marked this conversation as resolved.
return incomingInput.overrideConfig.sessionId
}
// Provided in API body - incomingInput.chatId
if (incomingInput.chatId) {
if (typeof incomingInput.chatId !== 'string') {
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid chatId: must be a string')
}
Comment thread
yau-wd marked this conversation as resolved.
return incomingInput.chatId
}
}

// Hard-coded sessionId in UI
if (memoryNode && memoryNode.data.inputs?.sessionId) {
if (typeof memoryNode.data.inputs.sessionId !== 'string') {
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid sessionId: must be a string')
}
Comment thread
yau-wd marked this conversation as resolved.
return memoryNode.data.inputs.sessionId
}

Expand Down
Loading