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

Added mode to the eventStreamInitDict so that fetch can be disabled in the http request (mode = 'disable-fetch') #92

Closed
wants to merge 7 commits into from

Conversation

danwale
Copy link

@danwale danwale commented Jan 13, 2018

Added the ability to set the mode in the eventStreamInitDict to pass onto the HTTP Options of the http request. This allows 'disable-fetch' where you need to be able to abort the event stream connection.

In Chrome the http fetch option is used and this results in close() on the EventSource not being able to abort the request. I have multiple event-streams that I start and stop depending on the context in the application, I discovered that close() was leaving the connection open and once I reached the 6 concurrent streams to the same origin all future requests to that origin now got stuck in a queue.

This issue in the stream-http project is outlined here: jhiesey/stream-http#26. This problem flows into the eventsource project.

I wasn't sure of any automated tests that could be created for this, my test procedure was to monitor the connections in the Network tab of the Chrome debugger and see that the stream was closed when close() was called on the EventSource (it was always left open previously).

I also updated the mocha devDependency that came back as outdated to 4.1.0

@danwale
Copy link
Author

danwale commented Jan 23, 2018

This pull request is being abandoned, I the events don't fire at all when changed to XHR, the issue still exists but the problem is much deeper than I anticipated. The stream is started and data is being received, the XHR readystate fires but no data is read and pushed and parsed as the event stream.

@danwale danwale closed this Jan 23, 2018
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

Successfully merging this pull request may close these issues.

None yet

1 participant