ioBroker/ioBroker.socketio

Incompatibility of getVersion between lib/socket.js and example/conn.js

ar7bd opened this issue · 3 comments

ar7bd commented

Describe the bug
In change 321b3ed getVersion was modified to emit a 'null' as first argument (line 1200). Not sure if that is intended or not, but example/conn.js expects the version to be the first argument (line 403 and 417). either lib/socket.js should emit it as first argument or example/conn.js must be updated.

To Reproduce
servConn.getStates never calls its callback routine, because _checkAuth always bails out due to version parameter being null.

Expected behavior
Should work like before the change.

Versions:

  • Adapter version: socket.io 3.0.13
  • JS-Controller version: 3.1.6
  • Node version: v10.22.1
  • Operating system: ioBroker running on a Linux Nuc, conn.js used on Chrome/ Windows 10

It was intended and yes example needs to be adjusted

Im also using conn.js and have the same issue. Same versions as ar7bd.

No reading of states at startup using conn.js and socket.io-adapter.

My solution:
I fiddled with line ~640 and commented the return:

if (!this._checkConnection('getStates', arguments)) //return;

Now it reads states at startup again but uses "slow polling" instead of websockets (?)
Does NOT work, if you check "Only use Websockets" in socket.io-Adapter.

Would greatly appreciate an update so conn.js can run again as intended.

in fact duplicate of #32 ... there is also a workaround posted #32 (comment)