Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thoughts about slack user schema #2

Open
humorless opened this issue Jun 22, 2021 · 1 comment
Open

Thoughts about slack user schema #2

humorless opened this issue Jun 22, 2021 · 1 comment

Comments

@humorless
Copy link
Member

humorless commented Jun 22, 2021

https://github.com/oxalorg/clojurians-log-v2/blob/11b4de7bf78455a8329a2692b98488e83d76be21/schema.sql#L23

I got more and more questions and confused when I took a look at Slack user identity and user profile.
Say we need to store avatar image url, it looked like :image has a pattern that is
BASE_URL?s=${SIZE}&d=FIXED_DATA-${SIZE}.png

Maybe we should consider to generate them instead of storing them all?

  {:image_512
   "https://secure.gravatar.com/avatar/93bb0380fa58db691b7b54c519f6a69f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-512.png",
   :image_192
   "https://secure.gravatar.com/avatar/93bb0380fa58db691b7b54c519f6a69f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-192.png",
   :image_48
   "https://secure.gravatar.com/avatar/93bb0380fa58db691b7b54c519f6a69f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-48.png",
   :image_72
   "https://secure.gravatar.com/avatar/93bb0380fa58db691b7b54c519f6a69f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png",
   :image_32
   "https://secure.gravatar.com/avatar/93bb0380fa58db691b7b54c519f6a69f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-32.png",
   :image_24
   "https://secure.gravatar.com/avatar/93bb0380fa58db691b7b54c519f6a69f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-24.png",
@oxalorg
Copy link
Member

oxalorg commented Jun 22, 2021

Nice catch!!

Is it worth the hassle though? Even at 20k users, that's just an additional 200k strings stored in the database which seems quite small.

Also I can't find anywhere in the slack docs that guarantee that the URLs will always follow that pattern, what if that is not true for some older slack profiles (before they made it consistent?) 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants