-
Notifications
You must be signed in to change notification settings - Fork 852
Description
Description
After starting an RTM session, if there is an error which results in a reconnect, the call to rtm_connect does not pass the value of rtm_start to the reconnect call.
What type of issue is this? (place an x in one of the [ ])
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements (place an x in each of the [ ])
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
slackclient version: 1.2.x 1.3.x
python version: Python 3.6
OS version(s): Windows 10
Steps to reproduce:
- Start an RTM session with auto_reconnect True and with_team_state False
slack_client.rtm_connect(with_team_state=False,auto_reconnect=True) - Call rtm_read()
- Wait for a reconnect to occur (enterprise/large team) - cannot exactly reproduce
Expected result:
If "with_team_state" is False, it is expected that this boolean is passed to rtm_connect when it is called again upon restart (due to error or exception)
Actual result:
the call to rtm_connect only passes reconect=True to the function and not any other kwargs
Attachments:
From server.py websocket_safe_read() which is called from client.py rtm_read()
https://github.com/slackapi/python-slackclient/blob/07cce9bf15bee2e5151e88374f700fab46381d3d/slackclient/server.py
except WebSocketConnectionClosedException as e:
logging.debug("RTM disconnected")
self.connected = False
if self.auto_reconnect:
self.rtm_connect(reconnect=True)This also occurs in server.py send_to_websocket()
try:
data = json.dumps(data)
self.websocket.send(data)
except Exception:
self.rtm_connect(reconnect=True)and I'm not sure why but rtm_connect is called without arguments (thus using defaults) in the init method of Server if connect=False is not passed to Server when instantiating it.