From a1f7407eef913449ddaa065549f4a2497946a2b1 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 13 Feb 2025 13:13:52 -0800 Subject: [PATCH] Add arbitrary 1s wait after condition block to diagnose the out-of-order execution in production --- executor/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/executor/index.ts b/executor/index.ts index 9fed1b1ae7..24f7083c1a 100644 --- a/executor/index.ts +++ b/executor/index.ts @@ -264,6 +264,11 @@ export class Executor { routerDecisions.set(block.id, routerResult.response.selectedPath.blockId) } else if (block.metadata?.type === 'condition') { const conditionResult = await this.executeConditionalBlock(block, context) + // Add a wait here to simulate a slow condition block + const waitTime = 1000 + if (waitTime > 0) { + await new Promise((resolve) => setTimeout(resolve, waitTime)) + } activeConditionalPaths.set(block.id, conditionResult.selectedConditionId) }