Leonidas-from-XIV / slacko

A neat interface for Slack

Home Page:https://leonidas-from-xiv.github.io/slacko

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow caching id lookups

Leonidas-from-XIV opened this issue · comments

After talking with @eras today, the automatic lookup is causing him quite a bit of latency.

Multiple solutions are possible:

  • Caching: look it up once and that's it. Problem: channel might get renamed, so the cached id might point to a channel that is not the same as the one that was requested.
  • Caching and expiring: The id is looked up and stored for some time. Unfortunately, the cache might be out of date and pointing to the wrong channel. Even worse, when it expires, it might even point to a different channel or no channel at all.
  • Explicit name resolution for channel: It would be nice it there was a function, that takes a channel and and looks up it's id and returns a ChannelId channel. Something like channel_of_channel.

I currently tend toward the latter proposal, but happy to hear input on this.