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

[atmosphere.js] long-polling issue with jQuery Atmosphere 0.9 RC3 #274

Closed
mishoboss opened this issue Apr 10, 2012 · 8 comments
Closed

[atmosphere.js] long-polling issue with jQuery Atmosphere 0.9 RC3 #274

mishoboss opened this issue Apr 10, 2012 · 8 comments

Comments

@mishoboss
Copy link

There is a long-polling issue with the latest jQuery plugin. When call the socket.unsubscribe() the HTTP request is aborted, but a new one is initiated after the timeout passes. So, if you call for example 10 times unsubscribe() and then subscribe(), you will have 10 simultaneous HTTP long-poll connections.

@jfarcand
Copy link
Member

Integrated. Please try it and let me know if you can still reproduce (you haven't mention the browser used).

@mishoboss
Copy link
Author

Thank you, but the bug is still there. I test it with Google Chrome.
This is a snapshot from the Chrome's Developer Tools: http://m-design.bg/Capture.JPG
As you can see there are 5 Pending request, while there must be only one, as all others are terminated. But after the 59 seconds timeout, they are started again.

@jfarcand
Copy link
Member

Hum...I need a way to reproduce as I can't reproduce right now. Can you describe a quick way to reproduce?

@mishoboss
Copy link
Author

Yes. This is the pattern I use:

socket.unsubscribe();
socket.subscribe(...);

socket.unsubscribe();
socket.subscribe(...);

socket.unsubscribe();
socket.subscribe(...);
....

When socket.unsubscribe() is called, the previous request is aborted. However after the timeout that is specified in the subscribe() passes, it starts another request.

@jfarcand
Copy link
Member

Ok, I've just tested with

    var subSocket = socket.subscribe(request);
    socket.unsubscribe();
    subSocket = socket.subscribe(request);
    socket.unsubscribe();
    subSocket = socket.subscribe(request);
    socket.unsubscribe();
    subSocket = socket.subscribe(request);
    socket.unsubscribe();
    subSocket = socket.subscribe(request);
    socket.unsubscribe();
    subSocket = socket.subscribe(request);

I'm using 0.9-SNAPSHOT (latest version) so and I don't see any reconnect issue. I'm using Firefox and test with the atmosphere-chat sample (atmosphere/sample/chat/)

@jfarcand
Copy link
Member

OK I just find a way to reproduce.

@jfarcand
Copy link
Member

OK fixed, thanks a lot!

@mishoboss
Copy link
Author

The bug is gone! Thank you! :)

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

No branches or pull requests

2 participants