Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is Slack API not receiving my acknowledgement response ? #1585

Closed
4 of 7 tasks
FE-POLY opened this issue Jan 26, 2023 · 5 comments
Closed
4 of 7 tasks

Why is Slack API not receiving my acknowledgement response ? #1585

FE-POLY opened this issue Jan 26, 2023 · 5 comments
Labels
auto-triage-stale question M-T: User needs support to use the project

Comments

@FE-POLY
Copy link

FE-POLY commented Jan 26, 2023

Hello,

My app uses Slack to send users messages. In those Slack messages, buttons are used as links to my app. But in doing so, I encountered the known warning icon issue : #869 . So I created a route in my back-end just to send a 200 response to Slack. But for some reason, the warning icon is still there, which means Slack doesn't receive my acknowledgement response... And I don't know why.

Here's my route, trying both a classic 200 response and the solution mentioned in #869 (see link above) :

router.post(
  "/mySlackRoute",
  asyncHandler((req, res) => {
    const slackApp = req.context.slackApp;
    slackApp.app.action("mySlackButtons", ({ ack }) => ack());
    res.sendStatus(200);
  })
);

And here's how my Slack message button is created (with Slack Bolt) :

{
    type: "button",
    text: {
      type: "plain_text",
      emoji: true,
      text: text,
    },
    url: baseUrl + "/api/slack/mySlackRoute",
    action_id: "mySlackButtons",
  };

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • @slack/socket-mode
  • @slack/types
  • I don't know

Reproducible in:

The Slack SDK version

"slack/bolt": "^3.12.1",
"slack/oauth": "^2.5.4",

Node.js runtime version

v16.16.0

OS info

Ubuntu 22.04.1 LTS

Steps to reproduce:

(Share the commands to run, source code, and project settings)

  1. use the second piece of code above to create a button
  2. create a route with the first piece of code
  3. click the button

Expected result:

A warning icon does not display when clicking a button

Actual result:

A warning icon displays when clicking a button

@zimeg zimeg added question M-T: User needs support to use the project and removed untriaged labels Jan 26, 2023
@zimeg
Copy link
Member

zimeg commented Jan 26, 2023

👋 Hi @FE-POLY! This route looks good to me (thanks for sharing the code snippets!), so I'm wondering if there might be a problem in your app's interactivity configurations 🤔

Could you check that interactivity is enabled for your app in the App Config (select your app > Interactivity & Shortcuts > toggle on) and that your request URL matches what is expected by your router.post function?

As a note, this request URL might be different than the URL in your button. For example, if your backend is running on https://example.ngrok.io, then your request URL would be https://example.ngrok.io/mySlackRoute.

I hope this helps, but if your interactivity settings look correct and this warning still appears, could you share the error message that appears when hovering over the icon for further troubleshooting? Thanks!

@FE-POLY
Copy link
Author

FE-POLY commented Jan 27, 2023

Hi @e-zim and thank you for your answer.
Indeed, interactivity had not been toggled on. But I can't test if it's the only issue quite yet : my localhost URL logically doesn't work here (I get the "Rats, we couldn't make an HTTP request to that URL." error). Is there a way to test this while in development ?
I will probably have an issue in production too since the application is deployed on different domains, each for a different client with a different URL and I can only provide one URL here.

@zimeg
Copy link
Member

zimeg commented Jan 27, 2023

For local development, ngrok can be a pretty useful tool in creating a publicly accessible link to a port on your localhost. These docs might be helpful in setting this up.

As for your production case, I'm wondering if you could share more info around how you're deploying your app? Is the same app (with the same app ID) being hosted behind different domains, or does each domain have its own app instance? Also wanted to share that Socket Mode allows you to avoid Request URLs altogether in case this is a possibility for your app.

@github-actions
Copy link

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

@github-actions
Copy link

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-stale question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

2 participants