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

Timeouts cleared within websocket events cause zone to hang #149

Open
matthewp opened this issue Nov 6, 2017 · 1 comment
Open

Timeouts cleared within websocket events cause zone to hang #149

matthewp opened this issue Nov 6, 2017 · 1 comment
Labels

Comments

@matthewp
Copy link
Contributor

matthewp commented Nov 6, 2017

Consider this code:

var ws = new WebSocket(url);

var timeout = setTimeout(function(){
  // Testing if it worked.
}, 30000);

ws.onmessage = function(){
  clearTimeout(timeout);
};

This scenario happens with some socket.io logout libraries. The web socket message doesn't happen within a Zone, so the clearTimeout call doesn't cause the setTimeout's task to complete.

The fix is to make sure that websocket messages are wrapped within a Zone.

@matthewp matthewp added the bug label Nov 6, 2017
@matthewp
Copy link
Contributor Author

matthewp commented Nov 6, 2017

#108 is related.

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

1 participant