Closed patrickshuff closed 4 months ago
Hi @patrickshuff! I saw this was raised internally, and it looks like you may have received a resolution already, but I wanted to respond here and double-check – just in case anyone else runs into the same issue in the future. 🙂
As far as the thread I'm reading goes, it seems like the metadata was being returned as expected as seen in the payload screenshot provided above, but it just wasn't visible when inspecting the desktop client (as the client doesn't include metadata).
Is that correct? If I've gotten that wrong, please let me know, else we'll go ahead and close this issue if the issue is resolved.
I'll try and summarize the underlying issue, and some potential options for getting around this, and then my opinions on what the slack engineering team should do:
By default both on the RTM based message retrieval, and the API based message retrieval, any metadata EventPayload
that is sent that does not explicitly have that event metadata structure added to the application manifest is stripped out. However on both endpoints it still passes the EventType
through to the caller.
The recommended fix from slack is to add metadata for the underlying event to the slack app manifest as defined here: https://api.slack.com/automation/metadata-events
I have not verified this fix as I'm unable to do this at this time.
For the API based conversation.history method there is a flag called include_all_metadata
that is available in (thanks PR-1139) that you can pass that will have the server return all of the metadata. I have confirm this with the python and golang clients.
API Docs: https://api.slack.com/methods/conversations.history#arg_include_all_metadata
For the RTM based message retrieval, which I am using for my use case, you are out of luck because there is no option to pass in a flag like this.
This is a super confusing and painful developer experience to pass back the EventType
but strip out the EventPayload
. I spent an inordinate amount of time trying multiple SDKs on both the sending and receiving side to end up at the conclusion that the server must be stripping out the payload. The behavior that I'd rather see, in order of preference:
EventType
that is not registered and encourage them to do so instead of silently swallowing / discarding payload. e.g. on the server-side send back a HTTP400 with an error message that EventType
is not configured.EventType
and EventPayload
so no metadata is returned so your developers aren't spending a ton of time trying to figure out why they're sending in the EventPayload
incorrectly.Lastly you should make sure that your HTTP API and RTM based APIs are equivalent. I was elated to know there was a workaround with include_all_metadata
until I went back to the code realizing we were using the RTM interface to ingest messages to the bot.
Thanks for listening. I'll go ahead and close this out.
👋 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.
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.
Reproducible in:
This is reproducible using the python-sdk, the slack-go sdk, and when using
cURL
to post a message directly to the API.It should be noted this is not specific to python, this also happens when posting an equivalent messaging using the slack-go implementation. This is happening within the Netflix enterprise workspace.
The Slack SDK version
This happens both with the python SDK, and the golang sdk. Not specific to client.
Python runtime version
This happens both with the python SDK, and the golang sdk. Not specific to client.
OS info
This happens both with the python SDK, and the golang sdk. Not specific to OS.
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., setup.py))
Here is a screenshot showing the response running the above python and we can conclude that the
metadata
andevent_payload
is properly being sent to the API:This can also be reproduced with slack-go golang client:
Expected result:
The message should include both the
event_type
and theevent_payload
with the message like so:Actual result:
The message includes the
event_type
but theevent_payload
is not returned in the response. This is observed in the python SDK, the golang SDK, and the slack inspector. Here is message:I've also used the inspector in slack and verified that the metadata payload is also not being sent there either: