Skip to content

Allow binary data in HTTP streams #310

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 2 commits into from
Jul 30, 2025
Merged

Allow binary data in HTTP streams #310

merged 2 commits into from
Jul 30, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jul 22, 2025

This adds support for serving sync lines in BSON format through /sync/stream. The behavior is opt-in and will only be enabled when there's an Accept header and that header indicates a preference for the application/vnd.powersync.bson-stream content type.

This will allow the transport of binary data without the use of RSocket/Websockets, which may be something we need if we want to primarily use binary sync lines in the future (since RSocket on Dart continues to be uncertain).

When serving lines as BSON, we will simply concatenate them for the stream. Since the documents are length-prefixed, clients can split them fairly easily (see powersync-ja/powersync.dart#312, which I've used to test this).

Copy link

changeset-bot bot commented Jul 22, 2025

🦋 Changeset detected

Latest commit: 44403fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@powersync/service-core Patch
@powersync/service-core-tests Patch
@powersync/service-module-core Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-mongodb Patch
@powersync/service-module-mysql Patch
@powersync/service-module-postgres-storage Patch
@powersync/service-module-postgres Patch
@powersync/service-image Patch
test-client Patch
@powersync/service-schema Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simolus3 simolus3 requested a review from rkistner July 30, 2025 07:41
@simolus3 simolus3 merged commit 4a34a51 into main Jul 30, 2025
21 checks passed
@simolus3 simolus3 deleted the binary-http-sync branch July 30, 2025 09: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.

2 participants