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

User attributes saved to the hubot brain are lost on restart #738

Closed
dblandin opened this issue Aug 7, 2014 · 4 comments
Closed

User attributes saved to the hubot brain are lost on restart #738

dblandin opened this issue Aug 7, 2014 · 4 comments

Comments

@dblandin
Copy link
Contributor

dblandin commented Aug 7, 2014

Some context:

I'm using scripts such as github-credentials.coffee and harvest.coffee which save attributes to a user within the hubot brain.

Everything persists correctly while hubot is running but as soon as I need to restart hubot (for an upgrade or otherwise), all of the user data is lost.

I'm thinking that this might be related to how hubot loads user data on load, and instead of merging, the loaded user data is overriding the existing user data. Does that sound plausible?

I'm using the hubot-xmpp adapter.

├── hubot@2.8.0
├── hubot-scripts@2.5.15
├── hubot-xmpp@0.1.11
@technicalpickles
Copy link
Member

What do you have in hubot-scripts.json? If you don't have any *-brain.coffee scripts, it's only saved in memory.

If you do have one (like redis-brain.coffee), do you see any output during startup that the brain couldn't be connected?

@dblandin
Copy link
Contributor Author

We're using the redis-brain.coffee script. Seems to be connecting just fine.

Here's the behavior I'm seeing...

I set my githubLogin via github-credentials.coffee:

{
  "id": "devon",
  "jid": "room@conference.team.xmpp.slack.com/devon",
  "privateChatJID": "devon@team.xmpp.slack.com",
  "name": "devon",
  "type": "chat",
  "githubLogin": "dblandin"
}

I restart hubot. Here are some select start up logs:

[Wed Aug 13 2014 17:44:42 GMT-0500 (CDT)] DEBUG Loading adapter xmpp
[Wed Aug 13 2014 17:44:43 GMT-0500 (CDT)] INFO Hubot XMPP client online
[Wed Aug 13 2014 17:44:43 GMT-0500 (CDT)] INFO Hubot XMPP sent initial presence
[Wed Aug 13 2014 17:44:43 GMT-0500 (CDT)] DEBUG Joining room@conference.team.xmpp.slack.com/hubot
[Wed Aug 13 2014 17:44:44 GMT-0500 (CDT)] DEBUG Successfully connected to Redis
[Wed Aug 13 2014 17:44:44 GMT-0500 (CDT)] DEBUG Loading external-scripts from npm packages
[Wed Aug 13 2014 17:44:44 GMT-0500 (CDT)] INFO Data for hubot brain retrieved from Redis

Here's my user in the redis hubot brain after restart:

{
  "id": "devon",
  "room": "room@conference.team.xmpp.slack.com",
  "jid": "room@conference.team.xmpp.slack.com/devon",
  "privateChatJID": "devon@team.xmpp.slack.com",
  "name": "devon"
}

@dblandin
Copy link
Contributor Author

Seems like this may be related to slackapi/hubot-slack#63

@dblandin
Copy link
Contributor Author

I'm now using the new hubot-slack adapter and am no longer experiencing this issue. Seems to be up to the adapter to handle room switching properly.

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

No branches or pull requests

2 participants