Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jquery.atmosphere.js] problem using streaming transport in IE6 with trackMessageLength #1010

Closed
robert1111 opened this issue Apr 9, 2013 · 5 comments
Labels

Comments

@robert1111
Copy link

Environment: ie6 + streaming transport, with trackMessageLength set to true

Problem:
Every time a message arrives, the onMessage handler will be invoked twice: The first message got from onMessage is the size of the received message (added by TrackMessageSizeInterceptor or TrackMessageSizeFilter).

Fix (master):
Line: 1939 - 1945

                                            var skipCallbackInvocation = _trackMessageSize(text, rq, _response);

                                            if (!skipCallbackInvocation && !_handleProtocol(rq, _response.responseBody)){
                                                return "";
                                            }
                                        }

                                        if (!skipCallbackInvocation) _prepareCallback(text, "messageReceived", 200, rq.transport);

change to:

                                            var skipCallbackInvocation = _trackMessageSize(text, rq, _response);

                                            if (!skipCallbackInvocation && !_handleProtocol(rq, _response.responseBody)){
                                                return "";
                                            }
                                            if (!skipCallbackInvocation) _prepareCallback(_response.responseBody, "messageReceived", 200, rq.transport);
                                        }

The first parameter of the _prepareCallback function should be _response.responseBody instead of text.

@jfarcand
Copy link
Member

jfarcand commented Apr 9, 2013

Which verison of Atmosphere are you using?

@jfarcand
Copy link
Member

jfarcand commented Apr 9, 2013

Ah. Just saw you are using Master. Have you tested with other IE version by any chance?

jfarcand added a commit that referenced this issue Apr 9, 2013
@jfarcand
Copy link
Member

jfarcand commented Apr 9, 2013

Fixed. Thanks!

@jfarcand jfarcand closed this as completed Apr 9, 2013
@robert1111
Copy link
Author

I tried 1.0.12 and 1.1.0.RC1, both have the same problem, which also exists in Master as i examined the code.

BTW, I think it's better to move the line you fixed to the inner braces of

if (text.length != 0) {
    ...
}

(up one brace) since the variable skipCallbackInvocation is declared there, and _prepareCallback has to be invoked only when there is text content;-)

jfarcand added a commit that referenced this issue Apr 9, 2013
@jfarcand
Copy link
Member

jfarcand commented Apr 9, 2013

OK my bad. Fixed in master. But I'm unable to reproduce the issue with 1.0.12,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants