feat(v2): REAL Slack send confirmed working end-to-end
After the user added the missing OAuth scopes (channels:join, chat:write.public) and reinstalled the Slack App, updated the credential with the refreshed token and retried the real test send: SUCCESS. The digest message was actually posted to #chamados-suporte (channel C0BJNBTPFT5) by "Bot Coordenador", confirmed via the real Slack API response (ok:true, real message ts/channel/bot_profile returned). Code - Registrar Envio Sucesso correctly recorded status:'success' -- this record is intentionally left in place (not cleared like the earlier failed-test rows), since it now correctly represents a real send and its whole purpose is to prevent a duplicate resend of today's digest. Also found and fixed a real cosmetic bug from that same successful send: n8n's Slack node appends an "Automated with this n8n workflow" link footer by default (otherOptions.includeLinkToWorkflow defaults to true) -- not part of the message spec (minimal digest only). Disabled it. Added a regression test. Reverted SEND_ENABLED to false and deactivated pending final user confirmation before permanent production activation. 159/159 tests passing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
18ff9129cf
commit
26b06e07d5
@@ -788,7 +788,9 @@
|
||||
"value": "C0BJNBTPFT5"
|
||||
},
|
||||
"text": "={{ $json.mensagem }}",
|
||||
"otherOptions": {}
|
||||
"otherOptions": {
|
||||
"includeLinkToWorkflow": false
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
|
||||
@@ -788,7 +788,9 @@
|
||||
"value": "C0BJNBTPFT5"
|
||||
},
|
||||
"text": "={{ $json.mensagem }}",
|
||||
"otherOptions": {}
|
||||
"otherOptions": {
|
||||
"includeLinkToWorkflow": false
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
|
||||
@@ -148,6 +148,15 @@ test('node real de envio Slack existe (nao e so simulado/comentado)', () => {
|
||||
assert.equal(slackNode.onError, 'continueErrorOutput', 'precisa separar sucesso/falha pra idempotencia e nao-silenciar-erro');
|
||||
});
|
||||
|
||||
test('Slack node nao anexa o rodape automatico "Automated with this n8n workflow" (bug real: vazou na primeira mensagem real de teste)', () => {
|
||||
// O node Slack do n8n inclui esse link por padrao (includeLinkToWorkflow default: true) --
|
||||
// vazou pra dentro do canal real no primeiro teste de envio. A missao pede mensagem minima,
|
||||
// sem nada alem do que buildTopMessage gera.
|
||||
const wf = buildWorkflow();
|
||||
const slackNode = wf.nodes.find((n) => n.type === 'n8n-nodes-base.slack');
|
||||
assert.equal(slackNode.parameters.otherOptions.includeLinkToWorkflow, false);
|
||||
});
|
||||
|
||||
test('guard de envio roda antes do Slack e existe IF de decisao', () => {
|
||||
const wf = buildWorkflow();
|
||||
const guardConn = wf.connections['Code - Guard de Envio Slack'];
|
||||
|
||||
Reference in New Issue
Block a user