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

opera or xhr-polling quirks #55

Closed
dvv opened this issue Apr 17, 2011 · 6 comments
Closed

opera or xhr-polling quirks #55

dvv opened this issue Apr 17, 2011 · 6 comments

Comments

@dvv
Copy link

dvv commented Apr 17, 2011

Hi!

The following chunk of code:

// ...
now.ready(function() {
  console.log('NOW READY');
  var operaSucksOrXHRPollingSucksOrWhat = false;
  now.getContext(id, function(response) {
    if (operaSucksOrXHRPollingSucksOrWhat) return;
      operaSucksOrXHRPollingSucksOrWhat = true;
      console.log('GOT CONTEXT', response);
      // ...

illustrates the problem I previously described in #39

now.ready indeed is called once, but without the fuser I get two GOT CONTEXT lines in the console, which means the callback for my custom now.getContext is called twice. This quirk I noticed only when testing in Opera which fallbacks to xhr-polling socket.io method.

Can anyone confirm this behavior?

TIA,
--Vladimir

@ericz
Copy link
Contributor

ericz commented Apr 17, 2011

I have reproduced it.

It connects to the server twice, and thus all actions get doubled. Lets see whats causing it....

@dvv
Copy link
Author

dvv commented Apr 17, 2011

Interesting to check, whether it's xhr-polling, or Opera, who's failing?

@ericz
Copy link
Contributor

ericz commented Apr 17, 2011

Actually it seems like this is an issue with the internal dependency loaded callback being called twice.

This issue should be fixed in master.

@dvv
Copy link
Author

dvv commented Apr 17, 2011

Worth to mention: if the server downs and ups, now.ready is re-called if reconnection enabled. So anyone who puts singleton stuff into now.ready (my situation: Backbone.history.start()), be warned that you shouldn't.

@ericz
Copy link
Contributor

ericz commented Apr 21, 2011

Hmm I should get that in the documentation

@ericz ericz closed this as completed Apr 23, 2011
@juzerali
Copy link

@ericz: Is this resolved or just closed? Coz I am facing this issue.

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

3 participants