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] - streaming, junk issue #562

Closed
PavelR577 opened this issue Aug 16, 2012 · 3 comments
Closed

[jQuery] - streaming, junk issue #562

PavelR577 opened this issue Aug 16, 2012 · 3 comments

Comments

@PavelR577
Copy link

it looks like when the junk will be broadcasted in chunks it will break the logic of the junk remove

@xenster86
Copy link

Having the similar issue. It is reproducible when connection is done using remote host with high ping delay. Sometimes during initial handshake ' Welcome to the Atmosphere Framework' is not delivered fully and onMessage callback is being invoked with wrong text.

@PavelR577
Copy link
Author

@werdex - I solved it this way (incase you want to use my solution):

Just add a junkFull:false to the _response object and add this fix

 if (rq.transport == 'streaming') {
                                var text = responseText.substring(rq.lastIndex, responseText.length);
                                _response.isJunkEnded = true;

                                //fix junk is comming in parts
                                if (!_response.junkFull && (text.indexOf("<!-- Welcome to the Atmosphere Framework.") == -1 || text.indexOf("<!-- EOD -->") == -1)) {
                                    return;
                                }
                                _response.junkFull = true;

                                //if it's the start and we see the junk start
                                //fix for reconnecting on chrome - junk is comming in parts
                                if (rq.lastIndex == 0 && text.indexOf("<!-- Welcome to the Atmosphere Framework.") != -1 && text.indexOf("<!-- EOD -->") != -1) {
                                    _response.isJunkEnded = false;
                                }

@xenster86
Copy link

@poi212003 Thanks! It started to work fine in chrome.

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

No branches or pull requests

3 participants