Cache translation from channel and user name to ID (translation prone to failure)

Abierto
#271 16 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug?

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:

  1. Update channels_id to use conversations.list instead of channels.list. The tricky thing about this is that conversations.list only works with pagination, so it's not a simple drop-in replacement. It also means that if you do something like chat_postMessage(channel: 'general', text: 'foo') then for a team with many channels you might end up making hundreds of paginated calls to conversations.list before actually hitting chat.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.
  2. 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.list is not ideal for making the translation (see above) we could remove support for this altogether, forcing people to confront the issue directly.
  3. 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.

Lenguaje dominante
Ruby
Estrellas
1.3k
Forks
222
Merge medio
1 d 14 h
PR fusionados (30 d)
3

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de slack-ruby/slack-ruby-client

Todos los issues de slack-ruby/slack-ruby-client

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.