Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] JSON-RPC: RequestPacket serializes only the request portion, not the entire JSON-RPC request #15

Closed
Evalir opened this issue Nov 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Evalir
Copy link
Contributor

Evalir commented Nov 1, 2023

Component

json-rpc

What version of Alloy are you on?

latest

Operating System

macOS (Apple Silicon)

Describe the bug

When serializing a single RequestPacket, only the request part of the SerializedRequest is serialized, and doesn't the include the id or method. This means that an invalid request is created as no id or method is sent. This leads to the error Error response: ErrorPayload { code: -32600, message: "Invalid json-rpc request", data: None }

The fix I found was to add a new Payload struct that contains the id, method and params and serialize that.

@Evalir Evalir added the bug Something isn't working label Nov 1, 2023
gakonst added a commit that referenced this issue Nov 1, 2023
@Evalir
Copy link
Contributor Author

Evalir commented Nov 1, 2023

Fixed with #14

@Evalir Evalir closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant