mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(chat): run block execution state loader (#5759)
This commit is contained in:
@@ -148,7 +148,10 @@ describe('execution state lookup', () => {
|
||||
)
|
||||
mockMaterializeExecutionData
|
||||
.mockResolvedValueOnce({})
|
||||
.mockResolvedValueOnce({ executionState: EXECUTION_STATE })
|
||||
.mockImplementationOnce(async (executionData: Record<string, unknown>) => {
|
||||
const { traceStoreRef: _traceStoreRef, ...inlineValues } = executionData
|
||||
return { executionState: EXECUTION_STATE, ...inlineValues }
|
||||
})
|
||||
|
||||
const result = await getLatestExecutionStateWithExecutionId('workflow-1')
|
||||
|
||||
@@ -160,7 +163,6 @@ describe('execution state lookup', () => {
|
||||
expect(mockMaterializeExecutionData).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
{
|
||||
executionState: null,
|
||||
traceStoreRef: { id: 'value-2' },
|
||||
},
|
||||
{
|
||||
|
||||
@@ -142,8 +142,12 @@ export async function getLatestExecutionStateWithExecutionId(
|
||||
workflowId: row.workflowId,
|
||||
workspaceId: row.workspaceId,
|
||||
executionData: {
|
||||
executionState: row.executionState,
|
||||
[TRACE_STORE_REF_KEY]: row.traceStoreRef,
|
||||
...(row.executionState !== null && row.executionState !== undefined
|
||||
? { executionState: row.executionState }
|
||||
: {}),
|
||||
...(row.traceStoreRef !== null && row.traceStoreRef !== undefined
|
||||
? { [TRACE_STORE_REF_KEY]: row.traceStoreRef }
|
||||
: {}),
|
||||
},
|
||||
})
|
||||
if (state) return { executionId: row.executionId, state }
|
||||
|
||||
Reference in New Issue
Block a user