From 58d3955e01f0d792dfe45b174aa8ffdb0112323d Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 16 Aug 2024 16:54:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(transcript)=20Revert=20incorrec?= =?UTF-8?q?t=20recursive=20set=20variable=20at=20same=20block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/viewer/src/test/transcript.spec.ts | 2 +- packages/logic/computeResultTranscript.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/viewer/src/test/transcript.spec.ts b/apps/viewer/src/test/transcript.spec.ts index f8a1bda00..c93879989 100644 --- a/apps/viewer/src/test/transcript.spec.ts +++ b/apps/viewer/src/test/transcript.spec.ts @@ -26,7 +26,7 @@ test('Transcript set variable should be correctly computed', async ({ page.getByText('Assistant: "How are you? You said hey"') ).toBeVisible() await expect( - page.getByText('Assistant: "How are you? You said hey 3"') + page.getByText('Assistant: "How are you? You said hey 2"') ).toBeVisible() await expect(page.getByText('User: "hey"')).toBeVisible() await expect(page.getByText('User: "hey 2"')).toBeVisible() diff --git a/packages/logic/computeResultTranscript.ts b/packages/logic/computeResultTranscript.ts index 8d7177f64..aff2e0d30 100644 --- a/packages/logic/computeResultTranscript.ts +++ b/packages/logic/computeResultTranscript.ts @@ -132,7 +132,7 @@ const executeGroup = ({ nextGroup.blockIndex ?? 0 )) { if (stopAtBlockId && block.id === stopAtBlockId) return currentTranscript - while (setVariableHistory.at(0)?.blockId === block.id) + if (setVariableHistory.at(0)?.blockId === block.id) typebotsQueue[0].typebot.variables = applySetVariable( setVariableHistory.shift(), typebotsQueue[0].typebot