-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
When to "fail the connection" of an EventSource? #3789
Comments
Allright, just reading in the spec that all tasks for the EventSource should be queued to the remote event taks source. In Servo, we seem to use the networking task source, so in fact the solution to my problem would be to:
If this logic is correct, this issue can be closed... |
Yeah, your logic looks correct. Sorry about the implicit-ness of the task sources; we do that in a few places in the spec, and it's not great. But I agree with your conclusion. |
Ok, thanks for having looked into it! |
Question/possible bug:
The processing model of an EventSource mentions the following: "Any other HTTP response code not listed here, as well as the cancelation of the fetch algorithm by the user agent (e.g. in response to window.stop() or the user canceling the network connection manually) must cause the user agent to fail the connection."(emphasis mine)
The reference to window.stop() takes us to aborting a document load, which mentions in Step 2 "Cancel any instances of the fetch algorithm in the context of document", and also to "discard any tasks queued for them".
So the way I read it, when the fetch associated with an EventSource is cancelled, per the 'processing model' we should then move on to fail the connection, which means queuing a task, presumably on the networking task source, to do so.
So let's assume the following processing model:
window.close()
is called on that document's window.Does 5 not imply also cancelling the 'fail the connection' task?
Potential solutions I can think of:
For clarity, the only difference between 'failing the connection' or not, as part of (forcibly)closing an EventSource, is whether an 'error' event will be fired.
What do you think?
The text was updated successfully, but these errors were encountered: