-
Notifications
You must be signed in to change notification settings - Fork 853
Better support for multiple socket mode responses #1075
Description
Hello!
I'm working on integrating an application of ours with Slack, using more of the modern interactivity features (I'm starting with slash commands to get my footing but will be interested in things like message actions eventually!). Since the application that I'm integrating is already itself a framework, I'm using the SDK and not Bolt (I'm using the async API, if it matters). Our applications are not reachable from the internet, so we're using socket mode.
It's really handy to be able to send a payload in the acknowledgement response. However, it appears you cannot send multiple response payloads (at different times) for the same envelope ID. I can understand that, for non-socket mode apps, that makes sense: once you've replied to the first HTTP request, it's over, but websockets have no such limitation! Would it be possible for the Socket Mode API itself to support multiple responses for the same event (as identified by the envelope_id), so that you could update/delete a message, respond later, etc.?
If not, could the SDK offer something a bit more ergonomic here? The SDK is nice in that hides the implementation details of "what (async) HTTP/websockets client you're using and how," but it doesn't seem to offer anything to help use the response_url. I'm kind of tossed out of the SDK and left to my own HTTP devices, which is a bit jarring. I could borrow the internal session object of the client (or something similar), but that definitely feels like I'd be reaching past the abstraction. Perhaps the SocketModeRequest object could keep track if it's already been acknowledged and allow for future calls to send_socket_mode_response (of the various socket mode clients) to use the respose_url to smooth over the difference (especially since the socket mode clients already have a regular HTTP client for making the web API call to open the websocket)?
Category (place an x in each of the [ ])
- slack_sdk.web.WebClient (sync/async) (Web API client)
- slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
- slack_sdk.models (UI component builders)
- slack_sdk.oauth (OAuth Flow Utilities)
- slack_sdk.socket_mode (Socket Mode client)
- slack_sdk.audit_logs (Audit Logs API client)
- slack_sdk.scim (SCIM API client)
- slack_sdk.rtm (RTM client)
- slack_sdk.signature (Request Signature Verifier)