Skip to content

[Feature] Post ephemeral message using responseURL#27

Open
SirensOfTitan wants to merge 2 commits intomaxchehab:masterfrom
KintabaHQ:sirensoftitan/jun-3/responseURL
Open

[Feature] Post ephemeral message using responseURL#27
SirensOfTitan wants to merge 2 commits intomaxchehab:masterfrom
KintabaHQ:sirensoftitan/jun-3/responseURL

Conversation

@SirensOfTitan
Copy link
Copy Markdown
Contributor

This allows for use of response_url incoming webhook to post an ephemeral message (a common pattern after closing a modal, for example). It could easily be applied to message too, but I figured ephemeral was a good starting point.

Unfortunately, when posting a message or ephemeral message using response_url, slack doesn't give back the message_ts, just an "ok" or error code. To work around, I'm using the response_url as the key for the phelia cache instead of channel_id:message_ts. I prefix each action_id with the response_url transparently , then use that URL to look up the cache we need.

One caveat: response_url, I think, can be used up to three times within a 30-minute timeframe. I just assume that we use it to post one-and-only-one message. We may want to enforce this by ensuring the phelia cache incurs a miss when calling postEphemeralResponse.

Followups that would be valuable:

  1. Making it more explicit that ephemeral messages cannot actually use state. They cannot be updated per slack API.
  2. I think we probably need to have a clearer API for dealing with the various ways to respond to a slack message: triggerID and responseURL.
  3. Add postMessageResponse as well.

Very happy to work on those if we're feeling this is a good direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant