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

Slack RTM breaking changes #233

Open
binaryseed opened this issue Aug 10, 2020 · 7 comments · May be fixed by #235
Open

Slack RTM breaking changes #233

binaryseed opened this issue Aug 10, 2020 · 7 comments · May be fixed by #235

Comments

@binaryseed
Copy link
Contributor

Regarding the note in the Readme about the Slack API changes upon connect (rtm.start).. https://github.com/BlakeWilliams/Elixir-Slack#upgrading-from-0x-to-020

  1. I'm getting rate limited errors on even the first attempt to connect. Perhaps the Slack API s now rejecting rtm.start altogether?
  • I had to use the url /api/rtm.connect to get connected with the Slack API now
  • I had to tweak the Slack callback handle_connect to let you modify the slack portion of the internal state, which is necessary for any following state management to function
  1. Trying to initialize the Slack State requires more than the example code...
  • Slack state expects maps with the id as the key, not just a list
  • Slack state expects atom keys

These could be addressed fairly easily, but I'm not sure if there other implications...

@neodevelop
Copy link

Hi @binaryseed ! How are you doing the initializations of the state?

@acconrad
Copy link
Collaborator

acconrad commented Sep 2, 2020

@binaryseed if you Slack app is new (within the last 1.5 yrs or so) it won't work. See this page for details: https://api.slack.com/methods/rtm.start

@binaryseed
Copy link
Contributor Author

Here's the changes I made in a branch to make this work..

binaryseed@e9a9395

@binaryseed
Copy link
Contributor Author

And to initialize channels for example, I do this:

  def handle_connect(slack, state) do
    channels =
      Slack.Web.Channels.list(%{token: slack.token})
      |> Map.get(:channels)
      |> Map.new(&{&1.id, &1})

    slack =
      slack
      |> Map.put(:channels, channels)

    {:ok, {slack, state}}
   end

@acconrad
Copy link
Collaborator

acconrad commented Sep 2, 2020

@binaryseed want to create a pull request? Also please make sure you run the tests to ensure there are no regressions from this change

@binaryseed binaryseed linked a pull request Sep 2, 2020 that will close this issue
@binaryseed
Copy link
Contributor Author

Here we go: #235

Likely need to do some docs tweaks alongside it...

@marceldegraaf
Copy link

Any news on this change? Just received a "final notice" email from Slack regarding the upcoming changes to rtm.start and rtm.connect:

2022-09-02-11-05-14-QgJIMRUa@2x

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

Successfully merging a pull request may close this issue.

4 participants