Added support for rtm.connect. Fixes #190#209
Conversation
| rtm.start vs rtm.connect | ||
| --------------------------- | ||
|
|
||
| If you expect your app to be used on large teams, we recommend using starting the RTM client with `rtm.connect` rather than `rtm.start`, which is the default connection method for this client. |
There was a problem hiding this comment.
recommedation: ... rather than the default connection method for this client, rtm.start.
aoberoi
left a comment
There was a problem hiding this comment.
mostly looks good... but the age-old question: tests? it doesn't look like we have a very deep coverage right now, but i think for new changes we should aim to improve that situation.
| `rtm.connect` provides a lighter initial connection payload, without the team's channel and user information included. You'll need to request channel and user info via | ||
| the Web API separately. | ||
|
|
||
| To do this, simply pass `with_team_state=False` into the `rtm_connect` call, like so: |
There was a problem hiding this comment.
the word "this" is ambiguous and might refer to "requesting channel and user info via the Web API". maybe say "To get a lighter connection payload, ..."
| time.sleep(1) | ||
| else: | ||
| print "Connection Failed, invalid token?" | ||
| print "Connection Failed" |
There was a problem hiding this comment.
uhh.. this directory is supposedly ignored, you're still committing files here? might want to git rm -rf docs/_sources to get the actual delete as part of the commit
There was a problem hiding this comment.
ditto for the docs/.doctrees directory. seems like something that should be ignored too.
| :Args: | ||
| None | ||
| with_team_state (bool): Connect via `rtm.start` to pull workspace state information. | ||
| `false` connects via `rtm.connect, which is lighter weight and better for very large teams. |
There was a problem hiding this comment.
ending backtick after rtm.connect
| self.server.rtm_connect(use_rtm_start=with_team_state) | ||
| return True | ||
| # except: | ||
| # return False |
There was a problem hiding this comment.
why not just delete these lines?
There was a problem hiding this comment.
They weren't supposed to stay commented out 😐
|
so for the lines you just uncommented, if we actually removed them, wouldn't that also solve #181? jeez we should really have some tests. 😢 |
Codecov Report
@@ Coverage Diff @@
## master #209 +/- ##
==========================================
- Coverage 61.84% 61.76% -0.08%
==========================================
Files 9 9
Lines 304 306 +2
Branches 56 57 +1
==========================================
+ Hits 188 189 +1
- Misses 102 103 +1
Partials 14 14
Continue to review full report at Codecov.
|
|
@aoberoi it would, but if a dev is explicitly checking if rtm_connect is True as opposed to just seeing if it's truthy, it'd be a breaking change... 🤔 |
|
ah, thanks for pointing that out @Roach. we spoke about it in person and realized we can still fix the issue regarding the visibility of thrown exceptions (by not catching them and returning we should pop back into conversations where people wanted the entire |
|
Merging this with tests coming in a future release in order to resolve a customer issue. |
|
I am getting the below error: TypeError: rtm_connect() got an unexpected keyword argument 'with_team_state' |
* Added rtm.connect support * updated docs * updated gitignore * Uncommented lines which were accidentally left commented * Updated docs * Removed ignored doc source files * Fixed typo in method docs * fixed line length * updated rim start tests * regenerated docs
* Reverting slackapi#209 * Rebuilt docs to remove 'rtm.connect' references
Summary
Added support for rtm.connect. Fixes #190
With
rtm.start:Print channel count (should be 13)
With
rtm.connect:Print channel count (should be 0)
Requirements (place an
xin each[ ])