Skip to content

Fix #611 - stop propagating user exceptions to the connection management layer#665

Closed
seratch wants to merge 12 commits intoslackapi:masterfrom
seratch:new-sync-mode-issue-611
Closed

Fix #611 - stop propagating user exceptions to the connection management layer#665
seratch wants to merge 12 commits intoslackapi:masterfrom
seratch:new-sync-mode-issue-611

Conversation

@seratch
Copy link
Contributor

@seratch seratch commented Apr 30, 2020

Summary

As this pull request depends on #662, it has large diff but the change here is only 469a52b

This pull request fixes #611 by stopping the propagation of user exceptions to _connect_and_read() method. Raised exceptions to _connect_and_read() results in WebSocket connection closure. That is not intended in the scenarios where developers don't handle (or forget handling) exceptions in their methods decorated by @RTMClient.run_on.

If you'd like to add comments smoothly (I know loading the diff on GitHub for this takes a bit long and it's very slow to browse), please leave comments to seratch#1

Requirements (place an x in each [ ])

seratch added 10 commits April 30, 2020 17:03
* slackapi#530 Fixed by changing _execute_in_thread to be a coroutine
* slackapi#569 Resolved by removing a blocking loop (while future.running())
* slackapi#645 WebClient(run_async=False) no longer depends on asyncio by default
* slackapi#633 WebClient(run_async=False) doesn't internally depend on aiohttp
* slackapi#631 When run_async=True, RTM listner can be a normal function and WebClient is free from the event loop
* slackapi#630 WebClient no longer depends on aiohttp when run_async=False
* slackapi#497 Fixed when run_async=False / can be closed as we don't support run_async=True for this use case (in Flask)
@seratch seratch added Version: 2x bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:minor rtm-client v2.6 in-progress labels Apr 30, 2020
@seratch seratch added this to the 2.6.0 milestone Apr 30, 2020
@seratch seratch requested review from aoberoi and stevengill April 30, 2020 08:24
@seratch seratch self-assigned this Apr 30, 2020
@codecov
Copy link

codecov bot commented Apr 30, 2020

Codecov Report

Merging #665 into master will decrease coverage by 2.03%.
The diff coverage is 78.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #665      +/-   ##
==========================================
- Coverage   87.17%   85.13%   -2.04%     
==========================================
  Files          15       17       +2     
  Lines        1824     2025     +201     
  Branches      100      145      +45     
==========================================
+ Hits         1590     1724     +134     
- Misses        202      244      +42     
- Partials       32       57      +25     
Impacted Files Coverage Δ
slack/web/slack_response.py 90.38% <44.44%> (-9.62%) ⬇️
slack/rtm/client.py 77.55% <62.96%> (-6.86%) ⬇️
slack/web/__init__.py 77.41% <77.41%> (ø)
slack/web/urllib_client.py 81.02% <81.02%> (ø)
slack/web/base_client.py 74.60% <87.87%> (-5.22%) ⬇️
slack/web/client.py 96.04% <100.00%> (-0.80%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8dbf5af...48c6799. Read the comment docs.

@seratch
Copy link
Contributor Author

seratch commented May 11, 2020

This PR is outdated and hard to review. Check #679 instead.

@seratch seratch closed this May 11, 2020
@seratch seratch removed this from the 2.6.0 milestone May 24, 2020
@seratch seratch deleted the new-sync-mode-issue-611 branch December 1, 2020 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented rtm-client semver:minor Version: 2x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTM API exits upon callback raising exception

1 participant