xmppjs / hubot-xmpp

XMPP adapter for Hubot
181 stars 101 forks source link

Fix reconnection issues #66

Closed markstory closed 10 years ago

markstory commented 10 years ago

I think this resolves #58 and #63. When ejabberd - and I assume other xmpp servers - are hard reset node-xmpp gets a ECONNREFUSED error which prevents the reconnect option from working. In these situations, the end event is emitted. The adapter now handles this event and attempts to reconnect.

If this reconnection process fails the bot process will be terminated. This will allow process managers like supervisord to restart the bot.

Soulfire86 commented 10 years ago

Does anyone have confirmation that this fixes #58?

markstory commented 10 years ago

From my limited local testing with ejabberd it solved problems where hubot would not come online after ejabberd restart.

bnied commented 10 years ago

I'm still seeing duplicated responses and log entries, even with the new changes:

hubot-dev [9:05 AM] PONG

bnied [9:05 AM] [this command causes a reset with Slack] hubot-dev show storage

bnied [9:07 AM] hubot-dev ping

hubot-dev [9:07 AM] PONG

hubot-dev [9:07 AM] PONG

hubot-dev [9:07 AM] PONG

hubot-dev [9:07 AM] PONG

hubot-dev [9:07 AM] PONG

hubot-dev [9:07 AM] PONG

markstory commented 10 years ago

I'm not sure of what the problem is then. How is the connection being reset?

bnied commented 10 years ago

I'm running a command which is causing Slack to send an offline event.