While figuring out why https://github.com/mbland/hubot-slack-github-issues wasn't working for @geekdave, after some back-and-forth on 18F#51, we figured out it was because he was trying to use it in a private Slack channel.
What happened was that the channel ID was not in the Slack RTM client's channel cache, so SlackRtmDataStore.channelById was returning null. Impl.processMessage from lib/reaction-issue-filer.js wasn't expecting or handling this, hence the error.
After reviewing https://api.slack.com/rtm#channel_selection and https://api.slack.com/methods/rtm.start, it appears the solution may be a matter of trying to look in the groups and mpims caches for incoming channel IDs starting with G and the ims cache for IDs starting with D. (Note that, per the Slack rtm.start doc, "MPIMs are only returned to the client if mpim_aware is set when calling rtm.start.")
Reproducible in:
hubot-slack-github-issues version: git+https://git@github.com/mbland/hubot-slack-github-issues.git
OS version(s): any
Device(s): any
Steps to reproduce:
- Add
git+https://git@github.com/mbland/hubot-slack-github-issues.git to your Hubot instance.
- Per the https://github.com/mbland/hubot-slack-github-issues README, add
config/slack-github-issues.json to your Hubot instance. Use the default all-channel emoji from the mbland/hubot-slack-github-issues repo or configure your own.
- Set the following environment variables:
HUBOT_SLACK_TOKEN="<your Hubot's Slack API token>"
HUBOT_GITHUB_TOKEN="<a GitHub token for your Hubot user>"
HUBOT_LOG_LEVEL="debug"
- Launch your Hubot instance.
- In Slack, post a message to a private channel/group or direct message session.
- Add the emoji configured in step 1 to the message.
Expected result:
As with normal Slack channels, the plugin should react to the reaction_added event, file a GitHub issue, and respond to the user who added the reaction with the URL of the newly-created issue.
Actual result:
Hubot reacts to the event, but responds to the user with Cannot read property 'name' of undefined. The logs show a listener executed for Message [Object object] followed by DEBUG messages containing Sending to G... followed by Cannot read property 'name' of undefined. See @geekdave's screenshot from 18F#51, also attached below, for a concrete example.
Note that I'm working separately on making the error handling and logging more robust, regardless of upstream changes to hubot-slack.
Attachments:

Actions:
While figuring out why https://github.com/mbland/hubot-slack-github-issues wasn't working for @geekdave, after some back-and-forth on 18F#51, we figured out it was because he was trying to use it in a private Slack channel.
What happened was that the channel ID was not in the Slack RTM client's channel cache, so
SlackRtmDataStore.channelByIdwas returningnull. Impl.processMessage fromlib/reaction-issue-filer.jswasn't expecting or handling this, hence the error.After reviewing https://api.slack.com/rtm#channel_selection and https://api.slack.com/methods/rtm.start, it appears the solution may be a matter of trying to look in the
groupsandmpimscaches for incoming channel IDs starting withGand theimscache for IDs starting withD. (Note that, per the Slackrtm.startdoc, "MPIMs are only returned to the client if mpim_aware is set when calling rtm.start.")Reproducible in:
hubot-slack-github-issues version: git+https://git@github.com/mbland/hubot-slack-github-issues.git
OS version(s): any
Device(s): any
Steps to reproduce:
git+https://git@github.com/mbland/hubot-slack-github-issues.gitto your Hubot instance.config/slack-github-issues.jsonto your Hubot instance. Use the default all-channel emoji from the mbland/hubot-slack-github-issues repo or configure your own.Expected result:
As with normal Slack channels, the plugin should react to the
reaction_addedevent, file a GitHub issue, and respond to the user who added the reaction with the URL of the newly-created issue.Actual result:
Hubot reacts to the event, but responds to the user with
Cannot read property 'name' of undefined. The logs show a listener executed forMessage [Object object]followed byDEBUGmessages containingSending to G...followed byCannot read property 'name' of undefined. See @geekdave's screenshot from 18F#51, also attached below, for a concrete example.Note that I'm working separately on making the error handling and logging more robust, regardless of upstream changes to hubot-slack.
Attachments:
Actions: