Giter VIP home page Giter VIP logo

Comments (11)

achlee888 avatar achlee888 commented on August 18, 2024 1

Yes, as far as we can tell app.event is handling things fine and everything works until Slack API disables our events. When we had followed up they said link_shared is causing these. Not sure how these are happening since from our end in our service logs, everything looks ok.

How do we enable debug logging? That could be helpful.

All we know is that link_shared supposedly is having a high failure rate. But we can't find out where and the one area we can think of is ack's not happening automatically. The handler calls a service that generates an image that takes more than 3 seoncds...but that shouldn't matter if ack's are happening immediately.

from bolt-js.

zimeg avatar zimeg commented on August 18, 2024 1

I'm not so sure what might be causing this either - the image generation doesn't sound like it'd be a problem 📸 🤕

Using debug logs for a few attempts with the event might reveal something helpful! I'd be interested if you find things that seem strange or odd things otherwise 👀

const { App, LogLevel } = require('@slack/bolt');

const app = new App({
  ...
  logLevel: LogLevel.DEBUG,
});

from bolt-js.

bsoe003 avatar bsoe003 commented on August 18, 2024 1

👋 @zimeg,

Does it seem like your app might not be acknowledging these otherwise?

I had to manually override unhandledRequestHandler to set the response code as a 200. I'm not sure if the later version fixed this issue, but here the version of @slack/bolt for the reference: 3.12.2

from bolt-js.

zimeg avatar zimeg commented on August 18, 2024

Hey @achlee888 👋 Does your slack.event listener have logs when handling these events? Just want to check that link_shared is at least being received correctly by the app!

from bolt-js.

achlee888 avatar achlee888 commented on August 18, 2024

Yes, we do see link_shared events being received in the logs

from bolt-js.

zimeg avatar zimeg commented on August 18, 2024

Oh interesting... I remember finding something about link_shared domains potentially being removed from event subscriptions when failure conditions for the Events API are met.

Could you check that these unfurl domains match what you'd expect? Not sure if that's the cause, but this might've happened 😬

from bolt-js.

achlee888 avatar achlee888 commented on August 18, 2024

Yes, failure conditions (not responding to ack within 3 seconds) is what is causing our events being turned off.

The unfurl domains are set up correctly (works when testing individually and our customers are using the feature).

I believe the issue here is that slack is sending us link_shared events, and we are using app.event. However, the interface doesn't allow us to ack() directly from within app.event. This us unlock app.view or app.action where the callback params have ack available.

from bolt-js.

zimeg avatar zimeg commented on August 18, 2024

The unfurl domains are set up correctly (works when testing individually and our customers are using the feature).

Meaning app.event is handling the request alright and you can make API calls after? That's interesting since event listeners should ack immediately without needing to respond in the listener 🤔

I tested this on both the latest version 3.19.0 and version 3.7.0 and found both acknowledge the link_shared event with debug logs like this:

[DEBUG]  socket-mode:SocketModeClient:0 Received a message on the WebSocket: {"envelope_id":"662045ef-0c07-4b1f-9bdc-11bf88590d14","payload":{"token":"example","team_id":"T01234","api_app_id":"A01234","event":{"type":"link_shared","user":"U01234","channel":"C01234","message_ts":"1719027000.313859","links":[{"url":"https:\/\/example.com","domain":"example.com"}],"source":"conversations_history","unfurl_id":"C01234.1719027000.313859.0123456789","is_bot_user_member":true,"event_ts":"1719027000.729587"},"type":"event_callback","event_id":"Ev0799PVABCD","event_time":1719027000,"authorizations":[{"enterprise_id":null,"team_id":"T01234","user_id":"U01234","is_bot":true,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-example"},"type":"events_api","accepts_response_payload":false,"retry_attempt":0,"retry_reason":""}
[DEBUG]  socket-mode:SocketModeClient:0 Calling ack() - type: events_api, envelope_id: 662045ef-0c07-4b1f-9bdc-11bf88590d14, data: undefined

Is it possible that just the first log is appearing in logs? Or do logs only show the message that an "incoming event was not acknowledged within 3 seconds"?

from bolt-js.

bsoe003 avatar bsoe003 commented on August 18, 2024

Curious. Is it normal for POST request body to the events endpoint to be undefined?

I'm getting when i set logLevel to LogLevel.DEBUG:

ack() call begins (body: undefined)
ack() response sent (body: undefined)

After the second one, then we see our logs on our link_shared event listener (with all expected event information).

from bolt-js.

zimeg avatar zimeg commented on August 18, 2024

@bsoe003 an undefined body shouldn't be a problem! The 200 response is the required part when acknowledging requests though other details can be included for different requests.

After the second one, then we see our logs on our link_shared event listener (with all expected event information).

This sounds good to me! The ack response is sent before listeners are processed so additional logs should follow that response. Does it seem like your app might not be acknowledging these otherwise?

from bolt-js.

github-actions avatar github-actions commented on August 18, 2024

👋 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.

from bolt-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.