effect
effect copied to clipboard
JSON-RPC Serialization: Requests are never handled on the client
What version of Effect is running?
@effect/rpc: "0.71.1"
What steps can reproduce the bug?
On RpcServers Response we encode based on the RpcSerialization, which in the case of JsonRPC turns
[{"_tag":"Exit","requestId":"18","exit":{"_tag":"Success","value":"some value"}}]
into
[
{
"jsonrpc": "2.0",
"id": 18,
"result": "some value"
}
]
The next thing that's executing is run's on message handler on the client side which defaults to Effect.void for an unknown tag (which the response does not have).
Therefore JsonRPC Serialization results in requests never finishing because write is never called.
What is the expected behavior?
JsonRPC Serialization should be properly treated on the client side
What do you see instead?
Requests finish but client never knows about it
Additional information
No response
Presumably because decode is never called on the client, instead the RAW JSON is used here