jijo-paulose / node-xmpp-bosh

Automatically exported from code.google.com/p/node-xmpp-bosh
0 stars 0 forks source link

Regression starting from node-xmpp-bosh 0.4.3 (crash in stream.js) #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I open a WebSocket from my browser to node-xmpp-bosh > 0.4.2

node-xmpp-bosh-0.4.8/src/stream.js:203
        ++this._sn_info.length;
                 ^
TypeError: Cannot read property 'length' of undefined
    at BoshEventPipe.stat_stream_add (node-xmpp-bosh-0.4.8/src/stream.js:203:18)
    at WebSocketEventPipe.stat_stream_add (node-xmpp-bosh-0.4.8/src/websocket_draft10.js:74:28)
    at WebSocketConnection.<anonymous> (node-xmpp-bosh-0.4.8/src/websocket_draft10.js:167:19)
    at WebSocketConnection.emit (events.js:64:17)
    at WebSocketConnection.processFrame (dependencies/websocket/lib/WebSocketConnection.js:356:26)
    at WebSocketConnection.handleSocketData (dependencies/websocket/lib/WebSocketConnection.js:205:14)
    at Socket.<anonymous> (native)
    at Socket.emit (events.js:64:17)
    at Socket._onReadable (net.js:672:14)
    at IOWatcher.onReadable [as callback] (net.js:177:10)

Original issue reported on code.google.com by sonny.pi...@gmail.com on 30 Oct 2011 at 8:42

GoogleCodeExporter commented 9 years ago
Sorry I forgot de debug line:
WEBSOCKET::0a42fb48-6dd2-4369-b608-66eba2011228::Processing 
Message:<dummy><stream:stream to='******' xmlns='jabber:client' 
xmlns:stream='http://etherx.jabber.org/streams' version='1.0' /></dummy>

Original comment by sonny.pi...@gmail.com on 30 Oct 2011 at 8:57

GoogleCodeExporter commented 9 years ago
Can you share a sample websocket client file so that I can replicate the same?

Original comment by anup.kal...@gmail.com on 31 Oct 2011 at 10:38

GoogleCodeExporter commented 9 years ago
@Anup: We've been using this one: https://github.com/superfeedr/strophejs/

It will load up in the browser - Chrome specifically. I remember testing in 
Firefox too. You can ask for more info. on this on the github page though.

Original comment by dhruvb...@gmail.com on 31 Oct 2011 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by dhruvb...@gmail.com on 31 Oct 2011 at 12:11

GoogleCodeExporter commented 9 years ago
@Anup: Loading up examples/basic.html in your browser should do the trick. 
Also, change this line in basic.js "var BOSH_SERVICE = 
'http://bosh.metajack.im:5280/xmpp-httpbind'" to something more appropriate.

From the debug logs pasted, it seems as if the crash occurs when the stream is 
being created.

Original comment by dhruvb...@gmail.com on 31 Oct 2011 at 12:17

GoogleCodeExporter commented 9 years ago
@dhruvbird: is there any websocket client implementation in strophe? I believe 
this is only happening when trying to connect via a websocket not bosh. Bosh is 
already well tested. 

Original comment by anup.kal...@gmail.com on 31 Oct 2011 at 2:30

GoogleCodeExporter commented 9 years ago
Yes, it is happening with WebSocket.
The Strophe with WebSocket implementation can be found here: 
https://github.com/superfeedr/strophejs/tree/protocol-ed

If you would like, I can create a little test case.
But it seems here to appends with every browser/websocket method.

Original comment by sonny.pi...@gmail.com on 31 Oct 2011 at 3:17

GoogleCodeExporter commented 9 years ago
@Anup: yes, it is a websocket only thing. Sorry gave the wrong link. This is 
the right one: https://github.com/superfeedr/strophejs/tree/protocol-ed

Try basic.html. Changing basic.js to include:
proto = new Strophe.Websocket( WS_SERVICE ); should do the trick. Also, update 
"var WS_SERVICE = 'ws://msgboy.com:5288/ws-xmpp'" appropriately (it should be 
'ws://localhost:5280/' - don't go through an HTTP proxy for this one).

Original comment by dhruvb...@gmail.com on 31 Oct 2011 at 3:27

GoogleCodeExporter commented 9 years ago
Found the bug. I was not binding the stat_stream_add function to StreamStore. 
Will fix and upload by tonight.

Original comment by anup.kal...@gmail.com on 1 Nov 2011 at 2:49

GoogleCodeExporter commented 9 years ago
@Anup, but isn't it already part of the StreamStore prototype?

Original comment by dhruvb...@gmail.com on 1 Nov 2011 at 11:14

GoogleCodeExporter commented 9 years ago
Yes it is. But it is assigned to the bosh event pipe and called as a method
of bosh event pipe (bosh_server) from the web socket implementation. And
the web socket implementation does not know anything about the stream
store.

Original comment by anup.kal...@gmail.com on 2 Nov 2011 at 2:04

GoogleCodeExporter commented 9 years ago
Its fixed and committed as r454.

Original comment by anup.kal...@gmail.com on 2 Nov 2011 at 1:55

GoogleCodeExporter commented 9 years ago
@Anup @dhruvbird Thanks!

Original comment by sonny.pi...@gmail.com on 2 Nov 2011 at 1:59

GoogleCodeExporter commented 9 years ago
@sonny, please could you confirm and close if fixed at your end too.

Original comment by dhruvb...@gmail.com on 2 Nov 2011 at 2:51

GoogleCodeExporter commented 9 years ago
I confirm the bug is fixed. But since I'm not the owner of this issue I can't 
close it.

Original comment by sonny.pi...@gmail.com on 2 Nov 2011 at 3:37

GoogleCodeExporter commented 9 years ago

Original comment by dhruvb...@gmail.com on 2 Nov 2011 at 4:04