yuya373 / emacs-slack

slack client for emacs
1.11k stars 117 forks source link

Can no longer connect, `[error] request--callback: peculiar error: 429` #585

Open gravieure opened 1 year ago

gravieure commented 1 year ago

Describe the bug

I can no longer connect to Slack with emacs-slack. Nothing changed on my end which would have caused this behavior.

To Reproduce Steps to reproduce the behavior:

  1. Try connecting to slack with slack-start.
  2. Hit C-h e to show the *Messages* buffer.
  3. Note that it's full of repeated messages similar to:
    [error] request--callback: peculiar error: 429
    [2023-09-21 08:07:59] [warn] [Team-Name] Reconnecting... [1/360]

Expected behavior

It should connect to Slack.

Environment:

Additional context

HTTP status 429 is sent to clients when they exceed rate limits, which implies that either emacs-slack is failing to adhere to them, or perhaps Slack has noticed it and decided to block connections by lying to me.

Alternate theory: I've noticed for some time that emacs-slack would get some 429 responses when connecting, but it would eventually (after 2-3 attempts) succeed and start working. Perhaps I have a large number of channels or DMs open, and it's connecting, but the initial state is large, and emacs-slack doesn't rate limit those, so it fails immediately.

JasonSKK commented 1 year ago

Same problem here MacOS 10.13, Emacs 27.1

seblemaguer commented 1 year ago

@JasonSKK and @gravieure the solution is discussed in the issue #584, especially at this post https://github.com/yuya373/emacs-slack/issues/584#issuecomment-1728326996

gravieure commented 12 months ago

@JasonSKK and @gravieure the solution is discussed in the issue #584, especially at this post #584 (comment)

Thank you for the pointer, however, I'm experiencing a different problem. #584 is a 401 error trying to connect, while I'm getting a 429, which is typically used when a client exceeds the server rate limit. I pulled the jumper047/emacs-slack fork, and it doesn't work -- I still get 429 errors when I connect.

unhammer commented 7 months ago

So emacs-slack should rate-limit itself / pause a bit between each fetch?

gravieure commented 7 months ago

So emacs-slack should rate-limit itself / pause a bit between each fetch?

I believe this is likely the root of the issue.

Either that, or Slack fingerprints the client and returns a false 429 for unofficial ones.

isamert commented 6 months ago

So emacs-slack should rate-limit itself / pause a bit between each fetch?

I have implemented a poor-man version of such thing in my fork, see this: https://github.com/isamert/emacs-slack/blob/master/slack-conversations.el#L287-L337

I also have other stuff in my fork that is kind of special to my use-case where I disabled emoji downloads etc. to make connection smoother and it kinda works okay. Sometimes I run into issues but restarting emacs-slack works because connection goes smoothly.

seblemaguer commented 6 months ago

After few weeks, I confirm that it works for me