#326

Slack: `/_slack/simulate/block-actions` ignores buttons inside `attachments[].blocks`

Openjcardonneopened 21d ago

Problem

POST /_slack/simulate/block-actions searches only message.blocks for the button (routes/interactions.ts: const candidates = (message.blocks ?? []).flatMap(...)). Slack messages often put their blocks inside a coloured attachment (attachments: [{ color, blocks: [...] }]), which Slack renders and makes interactive the same way. For such a message the simulator answers action_not_found, although the button is visible in Slack and a real click produces a block_actions payload with container.type: "message_attachment" and container.attachment_id.

Checked on main at 4c0422e. Published 0.12.2 has no interactivity simulator at all, so this also needs a release that ships it (#289).

Reproduction

  1. chat.postMessage with attachments: [{ "color": "#d00", "blocks": [{ "type": "actions", "elements": [{ "type": "button", "action_id": "ack", "text": { "type": "plain_text", "text": "Ack" }, "value": "1" }] }] }].
  2. POST /_slack/simulate/block-actions with that channel, message_ts and action_id: "ack".

Actual: action_not_found.

Expected: the button is found and the delivered payload has container: { type: "message_attachment", message_ts, attachment_id: 1, channel_id, is_ephemeral }, as Slack sends (https://api.slack.com/reference/interaction-payloads/block-actions).

Activity

0

No activity yet.