You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Couldn't find a better place to put this, so thought I'd ask here...
For Slack bots that perform chat unfurls, there seems to be no way to get uniquely identifying information for a given message in a Slack Connect channel.
In a typical channel (non Slack Connect channel), if you're keeping track of multiple bot tokens in a database, you can you can simply store a slack bot token against a slackTeamId (or if you want to support multiple channels, you could nest that by locating slack tokens with a slackTeamId and a channelId) so that you're able to use the right token for a given unfurl event.
However, this model breaks down completely when using a bot to perform unfurls in a Slack Connect channel, as the event object that's received by your webhook can have a different slackTeamId than the team that own's the Slack Connect channel depending on the user that writes a message to the channel...
For anyone whose part of the team that uses the Slack Connect channel, their unfurls will work using the previous model, but will not work for anyone who's not part of the team, but has been invited to the channel, as their slackTeamId will be different.
Now, what is "unique" is the channelId that's returned from the unfurl event, but channelId's are not guaranteed to be unique across different teams, only within a team.
So... What I'm wondering is what the right approach to this is, or if using channelIds is a reasonable decision? (The chance of a collision seems astronomically low, but... wouldn't want any end users to experience a catastrophe.)
Any thoughts/info would be greatly appreciated!
Thanks,
Aaron
The text was updated successfully, but these errors were encountered:
I can definitely relate to what you mention here. The team_id etc. in the event payloads coming from a Slack Connect shared channels are quite confusing. A good news is that there is certainly a way to know the workspace (team_id) that installed your app.
Please refer to the following issue and pull requests for details but long story short, you can use $.authorizations[0].team_id to know the correct team_id.
Hi @inf3rnus, was my above comment helpful to you? If you have any follow ups, please let us know! If we don't hear back for a while, we may close this issue due to inactivity.
Hey there Slack team!
Couldn't find a better place to put this, so thought I'd ask here...
For Slack bots that perform chat unfurls, there seems to be no way to get uniquely identifying information for a given message in a Slack Connect channel.
In a typical channel (non Slack Connect channel), if you're keeping track of multiple bot tokens in a database, you can you can simply store a slack bot token against a slackTeamId (or if you want to support multiple channels, you could nest that by locating slack tokens with a slackTeamId and a channelId) so that you're able to use the right token for a given unfurl event.
However, this model breaks down completely when using a bot to perform unfurls in a Slack Connect channel, as the event object that's received by your webhook can have a different slackTeamId than the team that own's the Slack Connect channel depending on the user that writes a message to the channel...
For anyone whose part of the team that uses the Slack Connect channel, their unfurls will work using the previous model, but will not work for anyone who's not part of the team, but has been invited to the channel, as their slackTeamId will be different.
Now, what is "unique" is the channelId that's returned from the unfurl event, but channelId's are not guaranteed to be unique across different teams, only within a team.
So... What I'm wondering is what the right approach to this is, or if using channelIds is a reasonable decision? (The chance of a collision seems astronomically low, but... wouldn't want any end users to experience a catastrophe.)
Any thoughts/info would be greatly appreciated!
Thanks,
Aaron
The text was updated successfully, but these errors were encountered: