Unhandled exception within AutobahnJS using Flash socket in MSIE8-9

#1

To whom it may concern,

I am writing an app using Autobahn Python and AutobahnJS. I have had to use a Flash socket for IE8 and IE9.

The problem I am seeing is a JavaScript error that says this:

SCRIPT5007: Unable to get value of the property ‘wsuri’: object is null or undefined

autobahn.js, line 2952, character 4

When I go to this line this is what I see:

ab._connect = function (peer) {

// establish session to WAMP server

var sess = new ab.Session(peer.wsuri,

  // fired when session has been opened

  function() {

The bold, underlined section is the line of code generating the error (line 2952).

The conditions the produce this error are as follows:

Connect the client to the server, then killing the server starts the AutobahnJS reconnect code path. Everything works well using Autobahn Python and AutobahnJS in other browsers. I kill the server, and start it up again and my client using Autobahn JS reconnects like a charm

This only happens in IE8 and IE9, but Chrome, Firefox, and IE10 (all of which have the WebSocket built in) seem to handle this just fine. Is this a problem with my flash socket or autobahn ? Why am I not seeing this in other browsers ?

It seems that the object or peer.wsuri is not null in those browsers but it is in IE8 and IE9 ?

I am a bit lost in debugging this and any help would be greatly appreciated.

Jordan

0 Likes

#2

Sorry, in case it is not clear, it is the AutobahnJS reconnect code path (what autobahn does when the connection is lost) that gives the error. It attempts to reconnect and chokes on its first ‘retry’.

0 Likes

#3

I found a solution that you might want to use for people that must appease to Enterprise customers and thus are locked into developing for the internet abominations of IE8 and IE9.

IE8 and 9 do not allow a window.setTimeout functions with extra parameters, so instead of this, which I found in the autobahn.js file:

window.setTimeout(ab._connect, peer.options.retryDelay, peer);

it must be something like this:

window.setTimeout(function () {

ab._connect(peer);

}, peer.options.retryDelay);

This has appeared to solve the issue for me, I will keep this updated in case anybody needs it with new information.

0 Likes

#4

Jordan,

> I found a solution that you might want to use for people that must

appease to Enterprise customers and thus are locked into developing for
the internet abominations of IE8 and IE9.

I see. It's an unpleasant restriction, agree. Let's hope with automatic updates in IE10 and up enabled by default by MS, that situation will improve and updating IE no longer is something admins contemplate for years before doing it (since it's automatic;)

IE8 and 9 do not allow a window.setTimeout functions with extra
parameters, so instead of this, which I found in the autobahn.js file:

window.setTimeout(ab._connect, peer.options.retryDelay, peer);

it must be something like this:

window.setTimeout(function () {
               ab._connect(peer);
           }, peer.options.retryDelay);

Great that you found the origin of the issue!

If you file a pull request on GitHub against AutobahnJS with above patch, I'll merge that.

Cheers,
/Tobias

0 Likes

#5

OK, let me test it with what I have and then I will do that, thank you

0 Likes

#6

Pull request sent, let me know if I need to do anything else, I am new to Github.

Cheers!

Jordan

0 Likes

#7

Jordan,

Pull request sent, let me know if I need to do anything else, I am new
to Github.

Looks good. Merged. Thanks!

(Only thing: commit message could be a little more "concrete" than "Update Autobahn.js" - well, next time, I'm not unnecessarily picky with stuff like this .. especially on a first patch. Contributions are welcome)

I've merged your PR (pull-request), updated the bundled when.js and did a new AutobahnJS release: 0.8.1

Tagged on GH and published to S3:

http://autobahn.ws/js/downloads/

Could you test that release again in your setup so we can verify everything works as expected?

Thanks again for contributing to Autobahn!
/Tobias

···

Am 06.12.2013 17:31, schrieb Jordan Crook:

Cheers!

Jordan

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#8

Tobias,

Thank you for the feedback, next time I will better about that. I was not paying attention and missed how that would be included into the commit.

I just tested it in IE8, 9 and everything works as expected. Of course it works in Chrome as well.

Tchüss!

Jordan

0 Likes