Cache translation from channel and user name to ID (translation prone to failure)
还没有人认领这个 Issue。
评估
调研方向
Start with lib/slack/web/api/mixins/channels.id.rb and the background in #270. Compare the three proposed approaches, including conversations.list pagination and the current README guidance, then establish which behavior should be supported. Done means the chosen channel-name translation policy is implemented and the README accurately documents it.
由索引模型根据 Issue 内容生成。
描述
When a channel name is given for a channel parameter, rather than a channel ID, we are using channels.list to look up the ID of the channel and then using the ID in the request instead of the name.
However, channels.list is a legacy method and is no longer guaranteed to return every channel. This leads to a channel_not_found error if you pass a channel name for a channel that is not supported by channels.list.
A couple suggested solutions:
- Update
channels_idto useconversations.listinstead ofchannels.list. The tricky thing about this is thatconversations.listonly works with pagination, so it's not a simple drop-in replacement. It also means that if you do something likechat_postMessage(channel: 'general', text: 'foo')then for a team with many channels you might end up making hundreds of paginated calls toconversations.listbefore actually hittingchat.postMessage, which is not ideal. If we use this solution I think we should change the readme to discourage this approach and encourage using channel IDs directly. - Remove the translation completely, which would be a breaking change (but not the worst breaking change, since it's already basically broken). Since using
conversations.listis not ideal for making the translation (see above) we could remove support for this altogether, forcing people to confront the issue directly. - Leave it as it is, and update the readme to note that it does not always work and discourage its use.
See #270 for more background.
- 主要语言
- Ruby
- 星标
- 1.3k
- 派生
- 222
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slack-ruby/slack-ruby-client 的其他 Issue
-
new feature question
难度 2/5 1-3 小时 新手友好度 65/100
slack-ruby/slack-ruby-client#586 · 3 条评论 ·
-
bug?
难度 2/5 1-3 小时 新手友好度 45/100
slack-ruby/slack-ruby-client#579 · 3 条评论 ·
-
new feature web api
难度 3/5 1-2 天 新手友好度 42/100
slack-ruby/slack-ruby-client#482 · 5 条评论 ·
-
new feature
难度 4/5 3-5 天 新手友好度 35/100
slack-ruby/slack-ruby-client#414 · 14 条评论 ·
-
confirmed bug
难度 3/5 1-2 天 新手友好度 35/100
slack-ruby/slack-ruby-client#409 · 5 条评论 ·
查看 slack-ruby/slack-ruby-client 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
バグ
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 75/100
voxpupuli/puppet-epel#186 · 1 条评论 ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) 未关闭Bug Frontend
难度 2/5 1-3 小时 新手友好度 78/100