Remove binary_data field from protocol request #332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
binary_data
field on sync requests is supposed to be true if clients will receive data as BSON documents instead of as JSON.Since the sync service knows which format it'll use, this field doesn't actually have to be set by clients at all. Indeed it's not supposed to, but the Rust client sends it anyway. This could lead to an inconsistency between
binary_data
being true and binary data actually being sent:Accept: application/vnd.powersync.bson-stream
errors ifbinary_data
is not explicitly set to true in the request, because we're encoding values as BSON butbucketDataBatch
things it's JSON.binary_data: true
is a near-miss. This is what happens today with the Rust sync client, this only works because the unencoded events emitted bybucketDataBatch
are serialized in thendjson
transformer.binary_data
is now passed as a separate parameter to the sync stream.