Skip to content

rtm_connect does not pass all arguments when reconnecting #422

@fwump38

Description

@fwump38

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:

  1. Start an RTM session with auto_reconnect True and with_team_state False
    slack_client.rtm_connect(with_team_state=False,auto_reconnect=True)
  2. Call rtm_read()
  3. 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.

Metadata

Metadata

Assignees

Labels

Version: 1xbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions