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

Errors from the EventStream object returned by particle.getEventStream are not handled (e.g. if the stream dies, we don't detect it) #71

Open
kh90909 opened this issue May 9, 2016 · 0 comments
Labels

Comments

@kh90909
Copy link
Owner

kh90909 commented May 9, 2016

This issue can be reproduced in Chrome by temporarily switching network throttling to offline until you see a GET error in the console from https://api.particle.io/v1/devices/:deviceid/events.... If you turn off throttling at this point, events are no longer be received.

I tried adding a stream.on('error', ... handler to display_event():

    activeStream.on('error', function(err) {
      console.log('Subscribed event stream terminated with error. Attempting to restart.');
      activeStream.active = false;
      Promise.resolve()
        .retry(subscribe_events,retry_conditional,1)
        .then(display_event)
        .catch(error_handler);
    });

but this didn't seem to be called at all. It's possible that there's a bug in ParticleJS such that it doesn't actually pass on errors to the EventStream object.

@kh90909 kh90909 added the bug label May 9, 2016
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