fix(chat): run block execution state loader (#5759)

This commit is contained in:
Vikhyath Mondreti
2026-07-18 13:18:45 -07:00
committed by GitHub
parent 32de4155d8
commit 9560ffd2a0
2 changed files with 10 additions and 4 deletions
@@ -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 }