Skip to content

Reject malformed JSON-RPC messages instead of silently discarding them #6

@jserv

Description

@jserv

Summary

Response-shaped messages (has id, no method) are silently dropped in the transport layer. Per JSON-RPC 2.0 spec, the server should return -32600 INVALID_REQUEST.

Details

  • Messages with id but no method are silently discarded in both sync and async transports.
  • Fix: return INVALID_REQUEST (-32600) for these messages. Keep silent discard only for messages with no id (stale sampling responses).
  • Depends on: structured TransportError enum (makes the codec vs invalid-request distinction expressible without string-matching) and malformed protocol E2E tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    reliabilityCorrectness and reliability fixes

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions