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

Fix #632 Change the default settings to "useRtmConnect: true" #633

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

seratch
Copy link
Member

@seratch seratch commented Nov 24, 2021

Summary

This pull request fixes #632 -- refer to the issue for the context

Requirements (place an x in each [ ])

@seratch seratch added this to the 4.10.0 milestone Nov 24, 2021
@seratch seratch self-assigned this Nov 24, 2021
@codecov
Copy link

codecov bot commented Nov 24, 2021

Codecov Report

Merging #633 (1caa12c) into main (688682a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #633   +/-   ##
=======================================
  Coverage   83.82%   83.82%           
=======================================
  Files           6        6           
  Lines         408      408           
  Branches       91       91           
=======================================
  Hits          342      342           
  Misses         38       38           
  Partials       28       28           

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 688682a...1caa12c. Read the comment docs.

# https://api.slack.com/changelog/2021-10-rtm-start-to-stop
options.rtm.useRtmConnect = true
catch e
console.error(e)
Copy link
Member Author

@seratch seratch Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for better developer experience. The code has been silently ignoring the exception raised here.

@@ -9,9 +9,18 @@ exports.use = (robot) ->
# reacts to only messages by insalled workspace users in a shared channel
installedTeamOnly: process.env.INSTALLED_TEAM_ONLY?
try
options.rtm = JSON.parse(process.env.HUBOT_SLACK_RTM_CLIENT_OPTS)
catch
options.rtm = JSON.parse(process.env.HUBOT_SLACK_RTM_CLIENT_OPTS or '{}')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you set the env variable to an empty string, the parsing fails. This change improves the behavior in the scenario.

@seratch
Copy link
Member Author

seratch commented Nov 24, 2021

I've verified the behavior with an example Hubot app.

Copy link
Member

@stevengill stevengill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lattwood
Copy link

lattwood commented Dec 1, 2021

LGTM

@seratch seratch merged commit 19f8449 into slackapi:main Dec 21, 2021
@seratch seratch deleted the issue-632-useRtmConnect branch December 21, 2021 03:23
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

Successfully merging this pull request may close these issues.

Change the default settings to "useRtmConnect: true"
3 participants