libsql / hrana-client-ts

Hrana client for TypeScript and JavaScript
https://libsql.org/hrana-client-ts/
MIT License
23 stars 7 forks source link

Miniflare does not support `WebSocket.protocol` #2

Closed honzasp closed 1 year ago

honzasp commented 1 year ago

At the moment, the client always assumes Hrana 1 on Miniflare, because the negotiated protocol is not available there.

https://github.com/cloudflare/miniflare/issues/578

honzasp commented 1 year ago

We can no longer blindly fall back to Hrana 1 with JSON on Miniflare 2, because if the server supports Hrana 3, Protobuf encoding will be negotiated. However, Miniflare 3 uses the same runtime as actual Workers with correct WebSocket implementation, so this workaround is no longer necessary and will be removed in client version 0.5.0. If the client sees that WebSocket.protocol is undefined, it will throw an error, suggesting to upgrade to Miniflare 3.