🐛 Fix embed bubble wait for event not working in linked bot

Closes #2237
This commit is contained in:
Baptiste Arnaud 2025-07-01 11:55:26 +02:00
parent b6dd05199a
commit 97d050cc99
No known key found for this signature in database

View File

@ -119,7 +119,7 @@ export const walkFlowForward = async (
} while (
nextEdge ||
(!input &&
!clientSideActions.some((ca) => ca.expectsDedicatedReply) &&
!isDedicatedReplyNeeded({ clientSideActions, messages }) &&
(newSessionState.typebotsQueue[0].queuedEdgeIds?.length ||
newSessionState.typebotsQueue.length > 1))
);
@ -135,6 +135,17 @@ export const walkFlowForward = async (
};
};
const isDedicatedReplyNeeded = ({
clientSideActions,
messages,
}: {
clientSideActions: ContinueChatResponse["clientSideActions"];
messages: ContinueChatResponse["messages"];
}) =>
// Either a client side action expects a dedicated reply or the last message is an embed which means it waits for an event
clientSideActions?.some((ca) => ca.expectsDedicatedReply) ||
messages.at(-1)?.type === BubbleBlockType.EMBED;
type ContextProps = {
version: 1 | 2;
state: SessionState;