fix(journey): wait multi-output routing (EVO-1912)#89
Open
daniloleonecarneiro wants to merge 1 commit into
Open
Conversation
…ait-otherwise (EVO-1912) O no Wait com multiplas saidas (enableFallback / time_or_condition) roteava por nodeData.successNodeId/otherwiseNodeId/nextNodeId — campos que o FE nunca grava. Com eles nulos, o workflow caia no fallback outgoingEdges[0].target sem olhar o handle, tornando o roteamento dependente da ordem de insercao das arestas (nao-deterministico). Agora o backend resolve o handle de saida a partir do resultado do wait (success -> wait-success, timeout/cancelled -> wait-otherwise) e o workflow casa edge.sourceHandle === nextNodeHandle, igual conditional/split. Waits de saida unica retornam null e seguem a unica aresta. Roteamento legacy por id em node-data preservado para journeys que o persistam. - wait.node.ts: hasMultipleOutputs() + resolveWaitHandle() + constantes de handle - action-nodes.activities.ts: activity resolveWaitHandle - journey-execution.workflow.ts: resolve handle no resume do wait e seta nodeResult.nextNodeHandle (sobrevive a reassign generica de nextNodeId) - wait.node.spec.ts: 11 testes (handles, single-output, legacy id-based)
There was a problem hiding this comment.
Sorry @daniloleonecarneiro, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
O nó Wait com múltiplas saídas (
enableFallbackouwaitType=time_or_condition) desenha no FE os handleswait-successewait-otherwisee cria arestas com essessourceHandle. Mas o backend roteava pornodeData.successNodeId/otherwiseNodeId/nextNodeId— campos que o FE nunca grava. Com eles nulos, o workflow caía no fallbackoutgoingEdges[0].targetsem olhar o handle, tornando o roteamento dependente da ordem de inserção das arestas → não-determinístico (mesma classe da EVO-1902/D13, porém pior).Fix (lado backend)
Roteamento por
edge.sourceHandle, consistente com conditional/split:wait.node.ts:hasMultipleOutputs()+resolveWaitHandle()mapeia o resultado do wait → handle (success → wait-success,timeout/cancelled → wait-otherwise); waits de saída única retornamnull. ConstantesSUCCESS_HANDLE/OTHERWISE_HANDLE. Roteamento legacy por id em node-data preservado.action-nodes.activities.ts: nova activityresolveWaitHandle.journey-execution.workflow.ts: no resume do wait, resolve o handle e setanodeResult.nextNodeHandle(sobrevive ao reassign genériconextNodeId = nodeResult.nextNodeId); o bloco existente de matchsourceHandle === nextNodeHandleescolhe o destino determinístico.Waits de saída única não são afetados (handle
null→ segue a única aresta).Testes
wait.node.spec.ts: 11 testes (handles success/timeout/cancelled, single-output, legacy id-based).tsc -p tsconfig.json --noEmit: limpo.jest src/modules/temporal: 147 passam; as 4 falhas restantes são pré-existentes (EVOAI_CRM_API_TOKENnos nodes EVOAI, independentes).EVO-1912