Skip to content

Remove websocket transport, use binary HTTP stream when available #232

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

Merged
merged 7 commits into from
Jul 31, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jul 30, 2025

There have been a few issues with websocket streams that are tricky for us to fix. In particular, one issue we've seen is that the sync service sends lines exceeding the default message size for Darwin clients, causing connection resets. Worse, due to this KTOR bug, we can't even customize the frame size, making the WebSocket transport mode fundamentally unstable on Apple platforms.

So, this removes the experimental option for websockets from the SDK. Instead, it adopts the option for binary HTTP streams in the sync service. When both client and sync service are compatible with this, they'll send BSON data over the HTTP stream. That way, we have most of the benefits of the websocket protocol ported to HTTP.

This also configures the socket timeout option to twice the usual frequency used by the sync service, allowing us to detect broken HTTP connections.

Closes #208.

@simolus3 simolus3 requested a review from stevensJourney July 30, 2025 13:50
@simolus3 simolus3 marked this pull request as draft July 30, 2025 15:36
@simolus3 simolus3 marked this pull request as ready for review July 30, 2025 15:49
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the changes here, especially given the current issues with WebSockets on Apple platforms.

@simolus3 simolus3 merged commit c1bb07a into main Jul 31, 2025
5 checks passed
@simolus3 simolus3 deleted the http-bson branch July 31, 2025 07:37
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.

New sync client doesn't recover from a connection failure on Android
2 participants