fix(v2): Data Table - Buscar Envios Recentes needs alwaysOutputData (real bug found in DEV validation)
Found running the real validation execution against DEV: the envios
digest table starts empty (the normal state for every day until the
first successful send), the "get" operation returned 0 rows, and n8n
does not execute downstream nodes when a node outputs 0 items -- so
Code - Guard de Envio Slack, the IF, the real Slack node, and everything
else in the send branch silently never ran. This would have broken the
happy path on every single day in production, not just an edge case.
Fixed with alwaysOutputData: true on that node (forces at least one
output item even with 0 matches; the resulting empty {} item doesn't
false-positive in alreadySentSuccessfully since none of its fields match
a real record's shape). Re-ran the validation execution after the fix:
Code - Guard de Envio Slack now runs correctly (shouldSend: false,
reason: 'send_disabled' with SEND_ENABLED=false as expected), and the
IF node's true branch (Slack - Enviar Mensagem) is confirmed to never
fire while disabled.
Added a regression test asserting alwaysOutputData on this node.
157/157 tests passing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
d64b1132b9
commit
86039ecfe4
@@ -715,7 +715,8 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "code-guard-envio-slack",
|
||||
|
||||
@@ -715,7 +715,8 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "code-guard-envio-slack",
|
||||
|
||||
@@ -157,6 +157,17 @@ test('guard de envio roda antes do Slack e existe IF de decisao', () => {
|
||||
assert.equal(ifConn.main[1][0].node, 'Code - Pular Envio Slack');
|
||||
});
|
||||
|
||||
test('Data Table - Buscar Envios Recentes tem alwaysOutputData=true (bug real: 0 linhas -- caso normal do dia a dia -- parava o branch de envio inteiro)', () => {
|
||||
// Regressao: rodou de verdade contra o DEV -- a tabela de envios estava vazia (nenhum envio
|
||||
// ja aconteceu, o caso NORMAL de todo dia), o node "get" devolveu 0 itens, e o n8n nao
|
||||
// executa nenhum node downstream quando o node anterior produz 0 itens. Isso significa que
|
||||
// Code - Guard de Envio Slack, o IF, o Slack real, tudo -- nunca rodava em um dia comum.
|
||||
// alwaysOutputData:true garante pelo menos 1 item de saida mesmo com 0 linhas encontradas.
|
||||
const wf = buildWorkflow();
|
||||
const node = wf.nodes.find((n) => n.name === 'Data Table - Buscar Envios Recentes');
|
||||
assert.equal(node.alwaysOutputData, true, 'sem isso, um dia sem envios anteriores nunca chega a avaliar se deve enviar');
|
||||
});
|
||||
|
||||
test('nodes n8n-nodes-base.dataTable usam valores de operation validos (bug real: "getRows" nao existe, e "get")', () => {
|
||||
// Regressao: n8n_manage_datatable (a ferramenta MCP) usa a acao "getRows", mas o node
|
||||
// nativo n8n-nodes-base.dataTable usa o valor de parametro "get" -- nomes parecidos,
|
||||
|
||||
Reference in New Issue
Block a user