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

Usage of rtm.start may break in September #866

Closed
episod opened this issue Aug 10, 2022 · 8 comments
Closed

Usage of rtm.start may break in September #866

episod opened this issue Aug 10, 2022 · 8 comments

Comments

@episod
Copy link

episod commented Aug 10, 2022

Hello from Slack developer relations.

It looks like you're still using the rtm.start method to negotiate websocket URLs for connecting to the RTM API. On September 20, 2022 the response to rtm.start will change to that of rtm.connect -- without all the extra info about channels, users, and the workspace you've come to expect from rtm.start. You may want to get ahead of that date and verify you can still connect and use the Web API to retrieve current state information instead.

There will be a short preview of this behavior on September 13, 2022 but you can test it out today. More info about this deprecation announced back in October 2021 can be found here: https://api.slack.com/changelog/2021-10-rtm-start-to-stop

@michaeljoelphillips
Copy link

I suspect that I have encountered issues with the changes described above, as connecting via wee-slack prior to today (September 13th, 2022) was working.

Option changed: plugins.var.python.slack.debug_mode = "on"
Option changed: plugins.var.python.slack.debug_level = "5"
python: unloading script "slack"
python: script "slack" unloaded
python: loading script "/home/nomad/.weechat/python/autoload/wee_slack.py"
python: registered script "slack", version 2.8.0 (Extends weechat for typing notification/search/etc on slack.com)
Connecting to 4 slack teams.
python: stdout/stderr (slack): Traceback (most recent call last):
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 843, in handle_next
python: stdout/stderr (slack):     EVENTROUTER.handle_next()
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 836, in handle_next
python: stdout/stderr (slack):     self.handlers[function_name](j, self, team, channel, metadata)
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 3582, in handle_rtmstart
python: stdout/stderr (slack):     for user in login_data["users"]
python: stdout/stderr (slack): KeyError: 'users'
python: stdout/stderr (slack): Traceback (most recent call last):
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 843, in handle_next
python: stdout/stderr (slack):     EVENTROUTER.handle_next()
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 836, in handle_next
python: stdout/stderr (slack):     self.handlers[function_name](j, self, team, channel, metadata)
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 3582, in handle_rtmstart
python: stdout/stderr (slack):     for user in login_data["users"]
python: stdout/stderr (slack): KeyError: 'users'
python: stdout/stderr (slack): Traceback (most recent call last):
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 843, in handle_next
python: stdout/stderr (slack):     EVENTROUTER.handle_next()
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 836, in handle_next
python: stdout/stderr (slack):     self.handlers[function_name](j, self, team, channel, metadata)
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 3582, in handle_rtmstart
python: stdout/stderr (slack):     for user in login_data["users"]
python: stdout/stderr (slack): KeyError: 'users'
python: stdout/stderr (slack): Traceback (most recent call last):
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 843, in handle_next
python: stdout/stderr (slack):     EVENTROUTER.handle_next()
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 836, in handle_next
python: stdout/stderr (slack):     self.handlers[function_name](j, self, team, channel, metadata)
python: stdout/stderr (slack):   File "/home/nomad/.weechat/python/autoload/wee_slack.py", line 3582, in handle_rtmstart
python: stdout/stderr (slack):     for user in login_data["users"]
python: stdout/stderr (slack): KeyError: 'users'

@dlbeer
Copy link

dlbeer commented Sep 14, 2022

If it helps, the response to rtmstart now looks like this:

{
    "ok": true,
    "response_metadata": {
        "messages": [
            "[WARN] method_deprecated: Please use rtm.connect to connect to the RTM API instead. Learn more at https://api.slack.com/changelog/2021-10-rtm-start-to-stop"
        ]
    },
    "self": {
        "id": "Uredacted",
        "name": "daniel.beer"
    },
    "team": {
        "domain": "redacted",
        "id": "Tredacted",
        "name": "Human-Readable Redacted"
    },
    "url": "wss://wss-primary.slack.com/websocket/C-redacted",
    "wee_slack_process_method": "rtmstart"
}

It looks like another couple of API calls are required to get the channel and user lists. I'm happy to test/debug anything.

@michaeljoelphillips
Copy link

Now that the preview for the changes to rtm.start has ended, wee-slack is working. Unless patched, we can expect wee-slack to be broken again after September 20th.

@nipsy
Copy link

nipsy commented Sep 14, 2022

Just to say, I was bitten by this also. It looks like #857 includes the necessary bits to fix this already potentially.

@trygveaa
Copy link
Member

Sorry for the delay here and that I missed the preview period, and thanks for the heads up @episod!

@nipsy: You are indeed correct that #857 has fixed this by replacing the usage of rtm.start with other API methods. I'll try to get it merged and make a new release before Tuesday.

@trygveaa trygveaa pinned this issue Sep 19, 2022
@trygveaa
Copy link
Member

This has now been fixed with the 2.9.0 release.

@quite
Copy link
Contributor

quite commented Apr 24, 2023

Maybe this can be removed as a pinned issue?

@trygveaa trygveaa unpinned this issue Apr 24, 2023
@trygveaa
Copy link
Member

Ah, yes, thanks. I unpinned it now.

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

6 participants