You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON-RPC client accepts responses with an unrelated request ID #1331
The v1 JSON-RPC transport generates a request ID, but does not retain it when reading and parsing the response. Consequently, a response with an unrelated ID can be returned as the result of the current request.
Reproduced against main 897835ef664fb5c9fc4e1f5388e88a49c93e743c using a local HTTP server: have JSONRPCTransport.getTask send a request and return the existing GET_TASK_TEST_RESPONSE fixture from client/transport/jsonrpc/src/test/.../JsonMessages.java, whose response ID is the fixed cd4c76de-d54c-436c-8b9f-4c2703648d64. The client generates a new random UUID for the request but accepts that response and returns the Task. A regression expecting A2AClientException fails with Expected A2AClientException to be thrown, but nothing was thrown.
JSONRPCTransport.createPostBuilder calls JSONRPCUtils.toJsonRPCRequest(null, ...), which generates an ID internally. unmarshalResponse then parses the response and handles its error/result without comparing IDs. Please also check streaming events, pre-stream errors and the v0.3 client when fixing this; the reproduced case is a successful v1 GetTask response.
This resembles the fixes in a2aproject/a2a-go#591 and a2aproject/a2a-rs#560. A response error with id: null can be legitimate when the server could not determine the request ID, so that case needs distinct handling.
Activity