Skip to content
This repository has been archived by the owner on Nov 14, 2017. It is now read-only.

Chatbot process dies frequently to error from node-xmpp #29

Closed
uxdiogenes opened this issue May 28, 2013 · 2 comments · Fixed by #33
Closed

Chatbot process dies frequently to error from node-xmpp #29

uxdiogenes opened this issue May 28, 2013 · 2 comments · Fixed by #33

Comments

@uxdiogenes
Copy link

Looks to be a result of the node-xmpp module:

/Users/dbrito/skynetwork/chat-bot/node_modules/wobot/node_modules/node-xmpp/lib/xmpp/session.js:127
  this.connection.send(stanza.root());
                              ^
TypeError: Object   has no method 'root'
    at Client.Session.send (/Users/dbrito/skynetwork/chat-bot/node_modules/wobot/node_modules/node-xmpp/lib/xmpp/session.js:127:30)
    at null.<anonymous> (/Users/dbrito/skynetwork/chat-bot/node_modules/wobot/lib/bot.js:66:19)
    at wrapper [as _onTimeout] (timers.js:252:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
@uxdiogenes
Copy link
Author

The problem is probably partially also due to the constructor setting the bot to disconnect on error.

@uxdiogenes
Copy link
Author

Upon further investigation it looks like this code in bot.js:65 might be the problem, because node-xmpp Session.prototyp.send() seems to expect to be able to call .root() on what's passed in:

    this.keepalive = setInterval(function() {
      self.jabber.send(' ');
      self.emit('ping');
    }, 30000);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant