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

Recognise that connection handling is a developer concern #493

Closed
wants to merge 1 commit into from

Conversation

huntc
Copy link
Contributor

@huntc huntc commented Oct 15, 2024

Removes the logic to test for a connection error with Server Sent Events.

My original attraction to SSE was that the browser would handle the connection and re-connect if it can. It turns out, after many years of using SSE(!), I learn that browsers are not consistent in their reconnection policy. For a start, browsers can decide how long to wait before re-connecting.

SSE will re-connect automatically under certain conditions, but again there's no specification in terms of what these conditions should be. For example, an "503 - service unavailable" does not seem to cause a re-connect for Chrome, yet this is often a transient error.

In the end, you're left with implementing your own connection handling anyway. We therefore push the testing of the connecting state back on the developer.

I also clean up a couple of compiler/clippy warnings along the way, and fix the feature flag test for testing the net modules.

Removes the logic to test for a connection error with Server Sent Events.

My original attraction to SSE was that the browser would handle the connection and re-connect if it can. It turns out, after many years of using SSE(!), I learn that browsers are not consistent in their reconnection policy. For a start, browsers can decide how long to wait before re-connecting.

SSE will re-connect automatically under certain conditions, but again there's no specification in terms of what these conditions should be. For example, an "503 - service unavailable" does not seem to cause a re-connect for Chrome, yet this is often a transient error.

In the end, you're left with implementing your own connection handling anyway. We therefore push the testing of the connecting state back on the developer.

I also clean up a couple of compiler/clippy warnings along the way, and fix the feature flag test for testing the net modules.
@huntc
Copy link
Contributor Author

huntc commented Oct 15, 2024

Actually, I think the existing logic is just fine having looked inside WebKit. Closing.

@huntc huntc closed this Oct 15, 2024
@huntc huntc deleted the no-error branch October 15, 2024 06:46
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.

1 participant