You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.")
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:
guard against the channel info coming back as undefined to the extent possible, i.e. figure out how to handle messages from private channels if possible
produce a better error response if it still does come back undefined
The text was updated successfully, but these errors were encountered:
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 returningnull
. Impl.processMessage fromlib/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
andmpims
caches for incoming channel IDs starting withG
and theims
cache for IDs starting withD
. (Note that, per the Slackrtm.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:
git+https://git@github.com/mbland/hubot-slack-github-issues.git
to your Hubot instance.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.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 forMessage [Object object]
followed byDEBUG
messages 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:
The text was updated successfully, but these errors were encountered: