metajack / strophejs

The Strophe.js repository has moved to https://github.com/strophe/strophejs

Home Page:http://strophe.im/strophejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IE8/9 duplicated request & inactive session

solarsailer opened this issue · comments

Hi,

I have a problem with Internet Explorer (8 & 9, I don't have to support IE7-). Everything works fine in other browsers.

I have found some times ago that Internet Explorer dropped my strophe connection without any reasons, just after sending two requests with the same rid. By drop connection, I mean that I'm unable to send any logs anymore. The connection is still there, sending blank request every 60s.

Here is the traces which are outputted by Strophe :

Traces

It's just after the duplicated request that IE does not send request anymore. Just blank requests.

If I comment this._data.push(null) in :


        // if no requests are in progress, poll
        if (this.authenticated && this._requests.length === 0 &&
            this._data.length === 0 && !this.disconnecting) {
            Strophe.info("no requests during idle cycle, sending " +
                         "blank request");
            this._data.push(null);
        }

There is no problems anymore. Obviously, I don't want to do that, but I can't figure out why it works when I comment this line.

I'm struggling with that for a few weeks, and I can't find why only IE has a problem. Thanks for helping me.

Context : I have an old version of Strophe with some small modifications to match our needs. These modifications shouldn't affect this part of Strophe. I've also upgraded Strophe to see if it changes anything, but the bug is still there.

I've done some more work on that, and I've found out that the problem lies inside _dataRecv.

In this method, we treat the element's children with all the handlers. The problem is when the element has no child (like the empty body that I receive in IE).

        // line 2693
        Strophe.forEachChild(elem, null, function (child) {
            var i, newList;
            newList = that.handlers;
            that.handlers = [];
            for (i = 0; i < newList.length; i++) {
               // apply each handler for each child
            }
        });

I expect in my code that one of the callbacks are executed to allow the script to continue. As soon as I get an empty , no callback is executed, and I'm stuck.

Is there a reason why an empty element is not managed ?