fix(slack): handle approval buttons inline and update message after response#11665
fix(slack): handle approval buttons inline and update message after response#11665
Conversation
Confidence Score: 3/5
Important Files Changed
|
packages/pieces/community/slack/src/lib/actions/request-approval-message.ts
Outdated
Show resolved
Hide resolved
packages/pieces/community/slack/src/lib/actions/request-approval-direct-message.ts
Show resolved
Hide resolved
packages/pieces/community/slack/src/lib/actions/request-approval-message.ts
Show resolved
Hide resolved
|
Hi @kishanprmr @AhmadTash can you please resolve this and merge? 🙏 |
packages/pieces/community/slack/src/lib/actions/request-approval-direct-message.ts
Outdated
Show resolved
Hide resolved
packages/pieces/community/slack/src/lib/actions/request-approval-message.ts
Outdated
Show resolved
Hide resolved
… error The resume branch was accessing context.auth.access_token directly, which doesn't exist on the union type. Use getBotToken helper instead.
What does this PR do?
Fixes Slack approval flow buttons opening a JSON link in the browser and not getting disabled after clicking.
Explain How the Feature Works
Previously, the "Request Approval in a Channel" and "Request Approval from a User" actions used Slack button
urlproperties, which opened the resume webhook URL directly in the browser — showing raw JSON to the user. Buttons also remained clickable after responding, causing confusion.This PR makes two changes:
Buttons now use
valueinstead ofurl— Button clicks are handled inline via Slack's interactivity webhook and forwarded server-side by the existingparseAndReplyhandler. No browser tab opens.Message updates after response — On flow resume, the Slack message is updated via
chat.updateto replace the interactive buttons with a status indicator (:white_check_mark: Approvedor:x: Disapproved), giving clear visual feedback.Also adds the missing
channelquery param to the DM approval action so the message can be updated on resume.Relevant User Scenarios