moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 507 forks source link

client.emit is not a function #483

Closed behrad closed 8 years ago

behrad commented 8 years ago

In some cases I have

TypeError: client.emit is not a function
    at /root/chabok/source/node_modules/mosca/lib/persistence/abstract.js:89:16
    at /root/chabok/source/node_modules/mosca/lib/persistence/redis.js:216:7

Shouldn't client.emit('error') have been client.connection.emit('error')?

mcollina commented 8 years ago

Yes, good catch! PR?

behrad commented 8 years ago

sure 👍

behrad commented 8 years ago

Before creating PR, after checking out my upstream/master (which is mosca's master) I see tests are failing!?

mosca server should fail if persistence can not connect

mcollina commented 8 years ago

Not sure, things are passing here

behrad commented 8 years ago

Not on my side!

mcollina commented 8 years ago

tests are passing on the cloud.

behrad commented 8 years ago

Strange! I did it with commit -n !!!

mcollina commented 8 years ago

You might had some spurious/unwanted dependency on node_modules

behrad commented 8 years ago

don't know! did a clean fresh npm install