-
Notifications
You must be signed in to change notification settings - Fork 635
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
Redis brain data seems to be missing Slack Names - hubot-auth related #326
Comments
Yes, broke for me as well: hubot-archive/hubot-auth#42 |
@nsturnitin @DEGoodmanWilson New Code |
also found the issue with |
I think this should get bump from medium to high. As is breaks any form of authentication when using slack and leaves it completely open or unusable commands. |
This also breaks hubot-rbac. Same kind of issue, obviously. |
Bumping to high. Sorry this keeps getting delayed. |
it looks like it's using the RTM datastore at the bottom of the script... this was not in the old code posted above. https://github.com/slackhq/hubot-slack/blob/master/src/bot.coffee#L170 |
Is there any patch or workarround about this? |
The only workaround I could found so far as nick suggest here is to revert hubot-auth to version v1.2.0 and hubot-slack to v3.4.2 till a fix is done for this. The steps I followed are as follow Hope a fix is available soon for versions after 3.4.2 |
Can that the roll back mentioned by @asalaheldin works as a workaround for this problem for the time being, ran into it today with the hubot-keys script. |
workaround mentioned by @asalaheldin worked. Thanks. |
Temporary workaround to re-instantiate Slack names. I'm calling Slack's users.list() web API method to retrieve a list of users. robot.brain.on 'loaded', (data) ->
return unless robot.adapterName == 'slack'
robot.adapter.client.web.users.list (err, info) ->
if err
robot.logger.debug 'Cannot retrieve list of users'
return
for member in info.members
continue unless member?.id?
newUser =
name: member.name
realName: member.real_name
slack: member
delete robot.brain.data.users[member.id]
robot.brain.userForId member.id, newUser |
The hubot-auth module doesn't work very well in combination with hubot-slack, mainly because of slackapi/hubot-slack#326 We don't make extensive use of hubot-auth roles, so replace them with a thin wrapper over the user profile data provided by Slack so that we can distinguish between admins/non-admins and staff/guests.
Careful with the above workaround - by deleting the existing user info in the brain you will destroy any values already saved. For example - the hubot-auth list of roles that a user has. Or at least that was my experience. |
Does #381 fix this? Does an upgrade mess up the brain? |
As referenced by @sebastiandero and @ferrixh the #381 seems to be the fix of our issue here. I have just tried this and the users data have been loaded inside Hubot brain without any workaround just applied the new version of "hubot-slack" and "hubot-auth". Thanks a lot for mentioning this fix here guys |
it sounds like the latest word is that this issue is fixed. if anyone finds evidence that its still not working correctly, please leave a comment. |
Description
The redis brain data for user seems to be incomplete. I need to clarify if this is possibly a hubot-slack issue or more a hubot-auth issue.
The brain data seems to be incomplete for users. I am only get partial number of users (not all). Seems to be mostly just the users of the room it first joined. I assume this is expected?
But the user data only contains user ids, even the names are just user IDs at time. I try to flush the redis data and restart hubot to rebuild it but then I end up it not getting the user data at all.
Its like Hubot did not make the Slack API call to obtain the user list.
My Package JSON
Reproducible in:
{project_name} version: 4.3.1
OS version(s): Ubuntu 14.04
Expected result:
Redis brain data will contain slack user IDs and proper name.
Actual result:
The text was updated successfully, but these errors were encountered: