Skip to content

JSON-RPC Serialization: Requests are never handled on the client #5670

@sharedRoutine

Description

@sharedRoutine

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions