Skip to content

Fix send_rpc_request failing on error responses with a null id - #717

Merged
kingsznhone merged 1 commit into
michaelhly:masterfrom
wavebyrd:fix/jsonrpc-null-id
Oct 24, 2026
Merged

kingsznhone merged 1 commit into
michaelhly:masterfrom
wavebyrd:fix/jsonrpc-null-id

Conversation

@wavebyrd

Copy link
Copy Markdown
Contributor

send_rpc_request() raises a pydantic ValidationError instead of SolanaJsonRpcError when the error response has "id": null, because JsonRpcResponseEnvelope.id only accepts str | int. JSON-RPC 2.0 requires a null id when the server couldn't read the request id, and the websocket client already handles that case with request_id=None.

Made the envelope id optional and widened request_id on the error parser protocol and the default parser to match. Added a test with a null-id error response; it fails with ValidationError without the change.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.41%. Comparing base (09dddee) to head (4ad4179).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #717   +/-   ##
=======================================
  Coverage   95.41%   95.41%           
=======================================
  Files          25       25           
  Lines        1918     1918           
=======================================
  Hits         1830     1830           
  Misses         88       88           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kingsznhone

Copy link
Copy Markdown
Collaborator

looks good

@kingsznhone
kingsznhone merged commit 2ed6b2f into michaelhly:master Oct 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants