eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.14k stars 468 forks source link

`reconnect` is an unknown property option for the connection method. #131

Open michaeljota opened 6 years ago

michaeljota commented 6 years ago

I'm trying to set the reconnect property to true, but the follow message appears.

Error: Unknown property, reconnect. Valid properties are: timeout userName password willMessage keepAliveInterval cleanSession useSSL invocationContext onSuccess onFailure hosts ports mqttVersion

Is that property available in the current version? (1.0.3)

michaeljota commented 6 years ago

The same happen with the mqttVersionExplicit property, but this is added to the options object that I pass to the connect function.

badcock4412 commented 6 years ago

Michael,

Are you sure you have pulled the master branch from github? I've got an old version that has the reconnect feature missing and the mqttVersionExplicit not handled but I just pulled from master and everything seems to be in paho-mqtt.js.

michaeljota commented 6 years ago

As I said, the current version (1.0.3) is the one I use.

rianwouters commented 6 years ago

same here. I use https://unpkg.com/paho-mqtt@1.0.3/mqttws31-min.js But the reconnect code is not in there.

jpwsutton commented 6 years ago

Hi, Really sorry but it looks like the 1.0.3 release on npm is incorrect. It's showing as having much older code that is not part of the 1.0.3 release on GitHub. I'm fixing this now and will comment back with a resolution once done.

jpwsutton commented 6 years ago

Ok, I've now pushed the correct level of code to npm at version 1.0.4 (https://unpkg.com/paho-mqtt@1.0.4/paho-mqtt.js), I'll also be pushing the latest version to cdnjs as well.

jpwsutton commented 6 years ago

And for proof that the reconnect option now works: https://jsfiddle.net/1rLLrg4r/

ChristianMaehler commented 5 years ago

Hi, I can't find the 1.0.4 on cdnjs . Did you already push it?