oscartbeaumont / rspc

A framework for building typesafe web backends in Rust
https://rspc.dev
MIT License
1.1k stars 50 forks source link

Vanilla-Client: Procedures never resolve when websockets are disconnected #226

Open v-morlock opened 9 months ago

v-morlock commented 9 months ago

Hi,

i was playing around with the vanilla client and it seems like currently, requests will never resolve when they are performed against a websocket client and the client is disconnected...

export const client = createClient<Procedures>({
  transport: new WebsocketTransport("ws://localhost:4000/rspc/ws"),
});

await  await client.query(["..."]) // → won't resolve
Brendonovich commented 8 months ago

I think this is intentional, and it seems like tRPC does the same thing. Requests are queued until the websocket connects.

v-morlock commented 6 months ago

If this is the case, i think there should at least be a way for the frontend to either introspect this or to define a timeout..