From 2ca8a15dcc8ec79eddfaf7068fab4e1aa3241506 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Wed, 13 Aug 2025 12:29:03 +0400 Subject: [PATCH] switch from Buffer to Vec for now as buffers are not supported by default in browser --- packages/turso-sync-js/src/js_protocol_io.rs | 4 ++-- packages/turso-sync-js/sync_engine.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/turso-sync-js/src/js_protocol_io.rs b/packages/turso-sync-js/src/js_protocol_io.rs index 40044f6d2..fffd7d026 100644 --- a/packages/turso-sync-js/src/js_protocol_io.rs +++ b/packages/turso-sync-js/src/js_protocol_io.rs @@ -14,7 +14,7 @@ pub enum JsProtocolRequest { Http { method: String, path: String, - body: Option, + body: Option>, }, FullRead { path: String, @@ -134,7 +134,7 @@ impl ProtocolIO for JsProtocolIo { Ok(self.add_request(JsProtocolRequest::Http { method: method.to_string(), path: path.to_string(), - body: body.map(Buffer::from), + body, })) } diff --git a/packages/turso-sync-js/sync_engine.ts b/packages/turso-sync-js/sync_engine.ts index 4a001dfae..dac182a76 100644 --- a/packages/turso-sync-js/sync_engine.ts +++ b/packages/turso-sync-js/sync_engine.ts @@ -66,7 +66,7 @@ async function process(opts, request) { const response = await fetch(`${opts.url}${requestType.path}`, { method: requestType.method, headers: opts.headers, - body: requestType.body + body: requestType.body != null ? new Uint8Array(requestType.body) : null, }); completion.status(response.status); const reader = response.body.getReader();